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

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

From
David Glasser <glasser@davidglasser.net>
Date
Feb 12, 2015, 18:42 UTC
Message-ID
<CAN7QDoLEbq47ic61_Bryz1yS=dk5WUGuhuGmmi-jY4eZ9qQ6ng@mail.gmail.com>
In-Reply-To
<20150212121258.GA28801@peff.net>
On Thu, Feb 12, 2015 at 4:12 AM, Jeff King <peff@peff.net> wrote:
Show 24 quoted lines
> On Thu, Feb 12, 2015 at 12:35:48PM +0100, Michael Haggerty wrote:
>
>> > I assume you are already munging in your editor the template provided by
>> > "git commit" after the squash? What would be really nice, IMHO, is if
>> > there was a way to set the author during that edit (e.g., by moving one
>> > of the "Author:" lines to the top of the file). That would cover your
>> > use case, I think, and would also be useful in general.
>>
>> If only Git supported options on todo list lines [1], this could be
>> implemented via a "--use-author" option:
>>
>>     pick --use-author 1234556 blah
>>     squash 84392ab etc
>>     fixup 49106a5 another
>>
>> Happily, this would work with fixup, too, without forcing the user to go
>> into the editor. Also, it wouldn't require metadata to be read in-band
>> from the commit message.
>
> Yes, that would be nice, but I don't think David is using a sequencer
> todo list here at all. It's just:
>
>   git merge --squash pr/100
>   git commit
That's correct. I certainly know how to do
  git checkout pr/100
  git rebase -i master  # set things to squash, etc
  git checkout master
  git merge pr/100  # or cherry-pick or whatever

And that's how I always used to do it. But `merge --squash` is so much more convenient... except for the minor wrinkle of needing an extra manual step to give the original author their credit.

--dave
-- 
glasser@davidglasser.net | langtonlabs.org | flickr.com/photos/glasser/
Previous: Jeff KingNext: Junio C Hamano
Message 5 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.