-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support rebase and cherry-pick #25
base: master
Are you sure you want to change the base?
Conversation
e1c5d34
to
28e1d5c
Compare
|
||
func main() { | ||
err := cmdrunner.Execute( | ||
cmd.New("cherry-pick")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I didn't realize cherry-pick
supports --signoff
off the bat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something, but shouldn't this be cmd.NewWithSignoff("cherry-pick")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right, cherry-pick does support signoff - I'll fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a little more thought, I think the --signoff
on cherry-pick
was probably meant to sign off on the commits you are cherry picking (that previously only had an author). By setting this here, it would override any committer present on the original commit -- it feels like this might be desirable, but definitely deserves a second thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right. Assuming that they were probably using git-duet for the original commit, it should have both an author and a committer.
And, I don't think those should be touched during cherry-picking. You are only moving the commit from one branch/ref to another, the "ownership" of the original commit isn't changing.
And in practice (at least in most workflows I know), this is usually only used to get individual commits onto a production release or hotfix branch (otherwise you'd be doing a merge or rebase of a whole branch to git all commits). And, this often isn't even done by the original committer on large teams - it could be someone responsible for deploying the release or hotfix, not the original coder.
So, I think this is fine the way it is :)
Thanks for getting the ball rolling on this @thewoolleyman! I responded on the issue regarding getting your environment setup. |
README.md
Outdated
Suggested aliases: | ||
|
||
``` | ||
dci = duet-commit | ||
drv = duet-revert | ||
dmg = duet-merge | ||
drb = duet-merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have a couple copy/pasta errors here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see drb = duet-merge
- should be drb = duet-rebase
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think the github UI is confused, I amended the commit and it's correct in my repo now:
thewoolleyman@master#diff-04c6e90faac2675aa89e2176d2eec7d8R145
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just cloned it down from your repo on master, commit c21558e
It shows:
dmg = duet-merge
drb = duet-merge
dcp = duet-cherry-pick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, there were two typos! sorry, fixed the other now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Np, looks good now
3068804
to
c21558e
Compare
c21558e
to
8c0fd0e
Compare
Sorry for spamming but +1. We use rebase quite often and it's always a pain having to fix the authors of each commit. |
When should I expect this pull request to be accepted? |
@glestaris no worries -- can you describe your use case a little more? |
@jszwedko The problem we are seeing is that we lose information about the commiter in all the rebased commits. Just to give an example: I made a repo with
After running
So you are probably right that it has to do with Is there any better way of doing it? Thanks and sorry if this is now in the wrong PR. I am happy to create an issue if you prefer so :) |
Hi @glestaris, apologies for the delay, you are completely right, I missed that it uses the current user as the committer during rebases for rebased commits (which was noted in the conversation above). Giving that some additional thought, I do feel that if I am driving, I'd expect any rebased commits without a committer (read: the committer is same as the author with identical timestamps) to have me as the committer and keep the original author. However, if the commit I'm rebasing already has a committer different than the author (as it often will if users are pairing using this tool) I can see the case for wanting to keep the original committer on that commit instead of changing it to me. This PR in particular simply introduces a Unfortunately, given my quick review of the That leaves us with the following options:
I'll investigate the first option, but would love any other suggestions or insights. Thanks! |
There is also this language from http://git-scm.com/book/ch2-3.html:
which we might use to inform our approach. |
Fixes issue #24
FYI, I was unable to get the bats tests all running locally against master, I'm glad to provide tests if you can help me get the test environment going on my box.