git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Keep original author with git merge --squash?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2015, 19:30 UTC
Message-ID
<xmqq1tltobgy.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150213071041.GA26775@peff.net>
Jeff King <peff@peff.net> writes:
Show 20 quoted lines
> On Thu, Feb 12, 2015 at 03:32:37PM -0800, Junio C Hamano wrote:
>
>> > It also raises a question for the proposal in this thread: if there are
>> > multiple "Author:" lines, which one do we take? The first, or the last?
>> 
>> I was siding with David's "pay attention to in-buffer Author: only
>> when all of them agree".  When squash-merging a branch with two or
>> more authors, we would attribute the authorship silently and
>> automatically to you if you do not do anything special otherwise.
>
> That's probably reasonable. I was thinking more of a case where you made
> some fixups on top of somebody else's branch, and then used "git rebase
> -i" to squash them together. But I think we already use the authorship
> for the root of the squash in that case.
>
> This case collapses nicely if we make a slight tweak to your proposed
> behavior (or maybe this is what you meant). If there are multiple
> authors listed, we behave as if none was listed. That would leave the
> authorship as it behaves today (with the author of the first commit) if
> you do nothing, or you can override it by dropping all but one.

I actually was (and am still) wondering that "silently ignore all of them if there are multiple ones that contradict with each other" is a bad idea, and that was why the last item on the "possible alternatives" list was to error out and ask clarification.

Previous: Jeff KingNext: Jeff King
Message 15 of 18 in “Keep original author with git merge --squash?”
  1. David GlasserFeb 11, 2015
  2. Jeff KingFeb 12, 2015
  3. Michael HaggertyFeb 12, 2015
  4. Jeff KingFeb 12, 2015
  5. David GlasserFeb 12, 2015
  6. Junio C HamanoFeb 12, 2015
  7. David GlasserFeb 12, 2015
  8. Junio C HamanoFeb 12, 2015
  9. David GlasserFeb 12, 2015
  10. David GlasserFeb 12, 2015
  11. Junio C HamanoFeb 12, 2015
  12. Jeff KingFeb 12, 2015
  13. Junio C HamanoFeb 12, 2015
  14. Jeff KingFeb 13, 2015
  15. Junio C HamanoFeb 13, 2015
  16. Jeff KingFeb 13, 2015
  17. David GlasserFeb 13, 2015
  18. David GlasserFeb 13, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.