Jump to content


GitSwarm merge request

merge gitswarm

  • Please log in to reply
4 replies to this topic

#1 gkaran

gkaran

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 11 May 2017 - 06:07 AM

We recently set up GitSwarm in our company and we try to properly integrate it into our workflow. We have some developers working with p4 clients while others in some products work with git swarm.

The ones using GitSwarm follow classic git flow, meaning the create a (soft) branch, push their changes, create a merge request and then someone else review their code and merges it into the master branch.

Our problem is that for some reason in perforce changelists the author/commiter appears to be the one that merged the code and not the person that actually wrote it.

Has anyone else seen this and know how to overcome it? This obvisouly is something we want to avoid as we alter useful information this way.

#2 gkaran

gkaran

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 11 May 2017 - 11:48 AM

For now we agreed on a scheme to have the person who created the merge request actually perform the merge in order to keep the author right. This is still problematic though if more that one developers commit in the same branch.

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 232 posts

Posted 11 May 2017 - 09:39 PM

A merge can easily incorporate multiple changelists (in which case you have multiple contributing authors) and also include original content, so there's not necessarily a one-to-one correspondence from source changelist(s) to target changelist.

What I'd recommend would be including information about the original author(s) in the changelist description of the merge if you want it to be visible at a glance.  This could potentially be automated via a trigger (run "p4 resolved" before submit, or "p4 filelog @=CHANGE" after submit, to see the source revisions, and look up the corresponding changelist(s)).

There are also tools that will tell you about the origin of a merge changelist after the fact -- "p4 annotate -I" (and the corresponding option in Time-Lapse View) is really useful for finding the origin of a particular piece of content after it's been through multiple merges.

#4 gkaran

gkaran

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 12 May 2017 - 05:12 AM

Probably one of us is missing something here. My problem is that "p4 annotate" shows the name of the merger and not the name of the actual committer in the affected lines. Let me provide an example:

1. John Doe creates a new lightweight branch in gitswarm and makes some changes. Then they open a merge request.
2. Jane Roe reviews the code of John and sees that everything is OK and clicks on the merge button in gitlab.
3. The merge is now converted into a submitted changelist in perforce in the mirrored depot and the changelist has a description like dollows:

Quote

Merge branch 'john-doe-did-this' into 'master'

<merge request title>

<merge request description>

See merge request <merge request index>
Imported from Git
Author: Jane Roe <jane.roe@domain.com> 1494421951 -0400 (2017-05-10 09:12:31-04:00)
Committer: Jane Roe <jane.roe@domain.com> 1494421951 -0400 (2017-05-10 09:12:31-04:00)
Pusher: gitswarm
sha1: f4a827612110f701b6362acffe3d1282732e6e50
push-state: complete
parent-changes: 048a9e99660e7ae52d2a757167b935866f252525=[68286]/89c005c6b7edfc50dbe5cc1039c56d2107976b75=[68238]


#5 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 232 posts

Posted 12 May 2017 - 03:01 PM

View Postgkaran, on 12 May 2017 - 05:12 AM, said:

My problem is that "p4 annotate" shows the name of the merger and not the name of the actual committer in the affected lines.

View PostSambwise, on 11 May 2017 - 09:39 PM, said:

"p4 annotate -I" (and the corresponding option in Time-Lapse View) is really useful for finding the origin of a particular piece of content after it's been through multiple merges.

(that's a capital I)

Although I've never used GitSwarm so I'm not sure if it's doing an actual Perforce merge -- if it's doing the merge in Git and then mirroring it over to Perforce in some way that doesn't keep the history I don't think there's a way to deal with that.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users