[problem with name-rev] (was: git log --graph with a sort of local revision number)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> "RA" == Rafael Ascensão <rafa.almas@xxxxxxxxx> writes:

   > You can achieve something close (on small repos, more on that later) with:
   > $ git log --graph --color \
   >   --format='%C(auto)changeset: %h:%H%nuser:      %an%ndate:      %ad%nsummary:   %s%n' \
   >   | git name-rev --refs=$(git rev-parse --abbrev-ref HEAD) --name-only --stdin


It seems that there is problem with name-rev.

Here's what I get when I start committing on master, then switch to a
branch foo and finally merge foo into master:

git init 
echo 1 > 1
git add 1
git commit -m 1
echo 1.1 > 1
git add .
git commit -m 1.1
git checkout -b foo master~1
echo 1.2 > 1
git add .
git commit -m 1.2
echo 1.2.1 > 1
git add .
git commit -m 1.2.1
git checkout master
git merge foo
echo 1.2.1/1.1 > 1
git add .
git commit -m "1.2.1/1.1"

Then 
 git log --graph --color --format='%C(auto)changeset: %h:%H%nuser:      %an%ndate:      %ad%nsummary:   %s%n'   | git name-rev --refs=$(git rev-parse --abbrev-ref HEAD) --name-only --stdin | more

Gives
*   changeset: ae68dbe:master
|\  user:      Uwe Brauer
| | date:      Tue Aug 20 16:25:53 2019 +0200
| | summary:   1.2.1/1.1
| |
| * changeset: c00bb5d:master^2
| | user:      Uwe Brauer
| | date:      Tue Aug 20 16:25:53 2019 +0200
| | summary:   1.2.1
| |
| * changeset: 54c9230:master^2~1
| | user:      Uwe Brauer
| | date:      Tue Aug 20 16:25:53 2019 +0200
| | summary:   1.2
| |
* | changeset: da0712f:master~1
|/  user:      Uwe Brauer
|   date:      Tue Aug 20 16:25:53 2019 +0200
|   summary:   1.1
|
* changeset: 8eb999d:master~2
  user:      Uwe Brauer
  date:      Tue Aug 20 16:25:53 2019 +0200
  summary:   1

That looks odd.

Any comments?

Uwe Brauer

<<attachment: smime.p7s>>


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux