I Found A Git Bug
文章目录
I have report this bug to upstream:
Here are steps of what I am doing:
First, I created two commits to a demo project.
when I use command:
|
|
cat 0000-cover-letter.patch
|
|
ok, you can see the cover letter has diffstat, just above “–”.
Then I change command to:
|
|
cat 0000-cover-letter.patch
|
|
Okay, you can see the diffstat is missing this time.
From: Eric Sunshine replay:
This is expected behavior according to this code in make_cover_letter() in builtin/log.c:
/* We can only do diffstat with a unique reference point */ if (origin) show_diffstat(rev, origin, head);
The problem is that when you format both patches of a two-commit repository,
origin
is NULL because there is no commit preceding the initial commit; the initial commit is the root of the history. Thus, there is nothing prior to the first patch against which to create a diffstat.
Hope this can be fix later.