git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Keep original author with git merge --squash?
@ 2015-02-11 17:21 David Glasser
  2015-02-12  9:28 ` Jeff King
  0 siblings, 1 reply; 18+ messages in thread
From: David Glasser @ 2015-02-11 17:21 UTC (permalink / raw)
  To: git

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@davidglasser.net | langtonlabs.org | flickr.com/photos/glasser/

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-02-13 19:55 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-11 17:21 Keep original author with git merge --squash? David Glasser
2015-02-12  9:28 ` Jeff King
2015-02-12 11:35   ` Michael Haggerty
2015-02-12 12:12     ` Jeff King
2015-02-12 18:42       ` David Glasser
2015-02-12 20:18   ` Junio C Hamano
2015-02-12 20:53     ` David Glasser
2015-02-12 21:23       ` Junio C Hamano
2015-02-12 22:16         ` David Glasser
2015-02-12 22:19           ` David Glasser
2015-02-12 22:34           ` Junio C Hamano
2015-02-12 22:50             ` Jeff King
2015-02-12 23:32               ` Junio C Hamano
2015-02-13  7:10                 ` Jeff King
2015-02-13 19:30                   ` Junio C Hamano
2015-02-13 19:55                     ` Jeff King
2015-02-13  0:17             ` David Glasser
2015-02-13  0:21               ` David Glasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).