Keep original author with git merge --squash?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I frequently find myself using `git merge --squash` to combine a
series of commits by the same author into one.

(For example, I fetch my project's GitHub PRs into my repo.
Frequently, a PR consists of the original PR (with a good description)
followed by a few follow-ups based on feedback from me.  While I'd
prefer that the submitter amended their original commit instead of
making it my job, this is rare.  And I don't feel that it's valuable
to my project's git history to contain all the intermediate stages of
code review --- it's usually just one commit.)

So `git merge --squash origin/pr/1234` is a really convenient command
here... except for one thing: it sets the author as me.  I always have
to manually find the author line and make sure to pass it to --author
(perhaps with --amend).

What would people think of a flag (or a config value) that means "if
all merged commits are by the same author, use that author for the
resulting commit instead of the default author"?

(I'm not sure if this should be a flag to --squash or to commit.
Maybe `git merge --squash`; `git commit --use-squashed-author`?  Seems
like it should be not too hard to implement; SQUASH_MSG is pretty
parseable.  Or just a config value.)

--dave

-- 
glasser@xxxxxxxxxxxxxxxx | langtonlabs.org | flickr.com/photos/glasser/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]