iprimo
iprimo

Reputation: 11

Unconventional method of using Git

I am working on a specific use case of automating code mgmt using git. I am not certain if git has this feature built in, or there is a product out there that does this already. I appreciate if you could point me towards the right direction.

The idea is simple, and the process as follows: (I understand this may not be the conventional way of using Git, and is a specific use case)

  1. A scheduler commits the code from a shared-repo between users to GitLab (using scheduler user_id)

  2. The day after users go through the applied changes to the code (using a GUI interface) and pick the changes made by them,

  3. A script\code modifies the commit to adjust the Git-Blame output based on users' entires in step 2 (this step may require breaking the commit to multiple commits and changing user Author)

Any help would be highly appreciated.

I did use 'git_blame_someone_else' code and a combination of rebasing\cherrypicking, however, I thought I might be trying too hard and this could be a build in feature in Git. (breaking commits and changing code Author)

Upvotes: 0

Views: 107

Answers (2)

LeGEC
LeGEC

Reputation: 51780

About step 1 : how are modifications entered in the shared-repo ? how is the code "committed" from the shared-repo to gitlab ?


  1. gitlab being a git server, it is perfectly suited for hosting a copy of your shared repo ;

  2. the standard way to use a shared repo among users is : each user creates commits, and then push these commits to the shared repo ; using this standard workflow, each user is registered as the author of the commit they created ;

  3. you can perfecty have several shared repositories, sharing stuff between repositories is genrally done by pushing or pulling from one copy to the other ; pusing and pulling do not alter the author of shared commits, so no extra action should be taken to have modifications mentionning their initial author.

Among points 1 2 and 3 above, which one do not match your current workflow ?
Could you please explain your use case in more details ?

Upvotes: 0

David Z
David Z

Reputation: 131550

No, git does not have this feature built in. The closest I can think of is interactive rebasing, which can let you break one commit into several (and even give them different authors), but it's meant to be a manual process, not something you would generally do from a script.

To be fair, it seems horrendously inefficient to combine different people's commits into one, only to have to break those commits apart later. What I'd actually suggest doing is reexamining and questioning the reasons that the default git workflow, where different people's commits stay as separate commits, doesn't work for you. I suspect you may find a better solution to that higher-level problem such that you don't have to do what you're describing.

Upvotes: 2

Related Questions