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, 20:53 UTC
Message-ID
<CAN7QDoLKFBCJpFa+QL8dPQtwyAyDNt-ck_sNJ3fS+vTrK_Lg9w@mail.gmail.com>
In-Reply-To
<xmqqpp9erihg.fsf@gitster.dls.corp.google.com>
On Thu, Feb 12, 2015 at 12:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> On Wed, Feb 11, 2015 at 09:21:04AM -0800, David Glasser wrote:
>>
>>> (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.)
>>
>> It sounds like "git commit -c" is close to what you want, which will
>> pull the author and commit message from a particular commit. But I don't
>> think there is a convenient way to name the commit in your case (it is
>> likely to be the first commit on the branch you are squash-merging, but
>> there isn't a shorthand for that).
>
> I thought David was primarily interested in the case where a branch
> authored by a single person, so specifying the tip of the branch
> being "merged" would be sufficient, no?

Well, using -c appears to override SQUASH_MSG entirely; it replaces the message as well as the author. Often I do want to make my own message based on all the messages provided by the submitter. (And typically the branch's tip is the least useful message anyway: it's usually something like "respond to code review".)

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