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

Re: help for git format-patch lost diffstat

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 25, 2022, 08:14 UTC
Message-ID
<xmqqk0bdy3zn.fsf@gitster.g>
In-Reply-To
<20220424064114.nwzldz5s2bnkrlu5@kong-HP>
FanJun Kong <bh1scw@gmail.com> writes:
Show 8 quoted lines
> First, I created two commits to a demo project.
>
> when I use command:
> git format-patch --cover-letter -1
> ...
> Then I change command to:
>
> git format-patch --cover-letter -2

Here is _one_ way I just came up with, that gives you a result identical to what you reported, and it is a perfectly understandable and expected outcome in _this_ scenario.

Preparation goes like this. Go to any single-parent commit and revert it.

  $ git checkout --detach seen^2
  $ GIT_EDITOR=: git revert HEAD
Now we have two commits.  Try formatting the topmost one:
  $ git format-patch --stdout --cover-letter -1 |
    sed -e "1,/^$/d" -e "/^-- /q"
  *** BLURB HERE ***
  Junio C Hamano (1):
    Revert "ci: call `finalize_test_case_output` a little later"
   t/test-lib.sh | 11 +++++------
   1 file changed, 5 insertions(+), 6 deletions(-)
  -- 
Now try formatting the twomost two:
  $ git format-patch --stdout --cover-letter -2 |
    sed -e "1,/^$/d" -e "/^-- /q"
  *** BLURB HERE ***
  Johannes Schindelin (1):
    ci: call `finalize_test_case_output` a little later
  Junio C Hamano (1):
    Revert "ci: call `finalize_test_case_output` a little later"
  -- 

The topmost commit had some effect on a single file, but when the effect of two topmost commits are taken together, they cancel out.

I am not saying these two commits are what you have, but the outcome obviously depends on what these two commits are, and if you do not show them, nobody would be able to help you.

Previous: Junio C Hamano
Message 6 of 6 in “help for git format-patch lost diffstat”
  1. FanJun KongApr 24, 2022
  2. FanJun KongApr 24, 2022
  3. Eric SunshineApr 25, 2022
  4. FanJun KongApr 25, 2022
  5. Junio C HamanoApr 25, 2022
  6. Junio C HamanoApr 25, 2022

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.