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

Re: [RFC PATCHv2 1/2] am: add gitk patch format

From
Chris Packham <judge.packham@gmail.com>
Date
Sep 4, 2014, 00:46 UTC
Message-ID
<CAFOYHZCcAwHwRy50kE8=rRwEOtrXovNkkKSQo2Gwcfvbve1Qwg@mail.gmail.com>
In-Reply-To
<xmqq38c8waub.fsf@gitster.dls.corp.google.com>
On Thu, Sep 4, 2014 at 11:19 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Chris Packham <judge.packham@gmail.com> writes:
>
>> Patches created using gitk's "write commit to file" functionality (which
>> uses 'git diff-tree -p --pretty' under the hood) need some massaging in
>> order to apply cleanly.
>
> Shouldn't that output routine be the one to be corrected, then?  We
> really do not need yet another format to express the same thing,
> especially from the same suite of programs.

That's an option. It shouldn't be too hard to make gitk use 'git format-patch --stdout' instead. The problem for me is that it's easier for me to update my git installation to get git am to accept the current format than it is for me to ask the people generating these patches to change their git/gitk installation to generate a different format.

Another thing that I've since realised is that this 'gitk' format is also what you've get from git show or git log -p. So this is actually allowing (for better or worse) things like 'git show $sha1 | git am --patch-format=gitk'[*1*]. That may mean that we should call the format something else ("pretty" perhaps?) and note that this is what gitk, git show and some incantations of git log generate.

-- [*1*] - Although I've just found a bug that affects the existing --patch-format=hg|stgit where reading from stdin is not currently supported. I'll send out a v3 of this series that includes some tests for those a bit later.

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 14 in “am: bug report and new patch format support”
  1. 0/1 am: bug report and new patch format supportChris Packham, Sep 3, 2014
  2. 1/1 am: add gitk patch formatChris Packham, Sep 3, 2014
  3. Chris PackhamSep 3, 2014
  4. Chris PackhamSep 3, 2014
  5. 0/2 am: bug fix and new patch format supportChris Packham, Sep 3, 2014
  6. 1/2 am: add gitk patch formatChris Packham, Sep 3, 2014
  7. Junio C HamanoSep 3, 2014
  8. Chris PackhamSep 4, 2014
  9. Junio C HamanoSep 4, 2014
  10. Chris PackhamSep 4, 2014
  11. 2/2 am: avoid re-directing stdin twiceChris Packham, Sep 3, 2014
  12. Chris PackhamSep 5, 2014
  13. Junio C HamanoSep 5, 2014
  14. Chris PackhamSep 5, 2014

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.