git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: "Rafael Ascensão" <rafa.almas@gmail.com>
Cc: Uwe Brauer <oub@mat.ucm.es>,
	git@vger.kernel.org, Alban Gruin <alban.gruin@gmail.com>
Subject: Re: git log --graph with a sort of local revision number
Date: Sun, 18 Aug 2019 22:46:18 +0200	[thread overview]
Message-ID: <87blwmmcbp.fsf@mat.ucm.es> (raw)
In-Reply-To: 20190818190032.GA11185@rigel

[-- Attachment #1: Type: text/plain, Size: 3482 bytes --]

>>> "RA" == Rafael Ascensão <rafa.almas@gmail.com> 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

Ok I see this is bash syntaxes.

In that case it works, but I see

* changeset: f40c01e:f40c01e41afbb87c7321147242354d46ddaee231
| user:      Uwe Brauer
| date:      Thu Aug 15 15:13:00 2019 +0200
| summary:   This is a test.
|
* changeset: 4dcf721:4dcf721042cd8f73d78876caf8f4796153c07023
| user:      Uwe Brauer
| date:      Wed Aug 14 14:33:29 2019 +0200
| summary:   Third
|
* changeset: 93083c8:93083c8b65141047c8346765fb663d5962076246
| user:      Uwe Brauer
| date:      Wed Aug 14 14:33:29 2019 +0200
| summary:   Second
|
* changeset: f59470f:f59470feb19d325accaad634025c229d6977df65
  user:      Uwe Brauer
  date:      Wed Aug 14 14:33:29 2019 +0200
  summary:   First commit

But on the GNU emacs repository which is reasonable old (has about 130
000 commits) and is around 700 MB, your command gives:


* changeset: ee1c638:master
| user:      Lars Ingebrigtsen
| date:      Sat Aug 17 17:30:42 2019 -0700
| summary:   Make `browse-url-of-buffer' work from zip files
|
* changeset: 3d1c9a7:master~1
| user:      Paul Eggert
| date:      Sat Aug 17 17:19:13 2019 -0700
| summary:   Fix org-timer-show-remaining-time > 1 hour
|
* changeset: f38a16e:master~2
| user:      Lars Ingebrigtsen
| date:      Sat Aug 17 16:56:13 2019 -0700
| summary:   Make `describe-function' say that disabled functions are disabled
|
* changeset: 3efe59a:master~3
| user:      Lars Ingebrigtsen
| date:      Sat Aug 17 16:47:16 2019 -0700
| summary:   Make newline-and-indent take a numeric prefix

Which is precisely what you said.


What did I do wrong in my test repo?

Which I generated via the following script


git init
echo "First" > test.org
git add test.org
git add create.sh
git commit -a -m "First commit"
echo "Second" >> test.org
git commit -a -m "Second"
echo "Third" >> test.org
git commit -a -m "Third"
echo "Forth" >> test.org
git commit  -a -m "Fourth"
echo "Fifth" >> test.org
git commit  -a -m "Fifth"
echo "Six" >> test.org
git commit  -a -m "Six"


   >     * changeset: 5fa0f52:master
   >     | user:      Junio C Hamano
   >     | date:      Fri Aug 16 10:28:23 2019 -0700
   >     | summary:   Git 2.23
   >     |
   >     *   changeset: 8e0fa0e:master~1
   >     |\  user:      Junio C Hamano
   >     | | date:      Fri Aug 16 10:22:51 2019 -0700
   >     | | summary:   Merge tag 'l10n-2.23.0-rnd2' of git://github.com/git-l10n/git-po
   >     | | 
   >     | * changeset: a6cd2cc:master~1^2
   >     | | user:      Jiang Xin
   >     | | date:      Tue Jul 30 10:02:22 2019 +0800
   >     | | summary:   l10n: zh_CN: for git v2.23.0 l10n round 1~2

   > And in this case, since we are using HEAD to describe the commits by
   > using --refs=$(git rev-parse --abbrev-ref HEAD), you can refer to
   > a6cd2cc either as master~1^2 or HEAD~1^2.

   > Now, git-name-rev has some memory/performance problems in repos with a
   > high number of references. Alban Gruin was working on this issue[1], but
   > I don't know what's the status of it.

   > [1]:https://github.com/agrn/git/tree/ag/fix-name-rev-leak

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

  parent reply	other threads:[~2019-08-18 20:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15  8:35 git log --graph with a sort of local revision number Uwe Brauer
2019-08-18 19:00 ` Rafael Ascensão
2019-08-18 19:16   ` Uwe Brauer
2019-08-18 20:46   ` Uwe Brauer [this message]
2019-08-18 20:55     ` [SOLVED] (was: git log --graph with a sort of local revision number) Uwe Brauer
2019-08-20 14:32   ` [problem with name-rev] " Uwe Brauer
2019-08-20 15:06     ` SZEDER Gábor
2019-08-20 17:49     ` Rafael Ascensão
2019-08-20 18:21     ` [problem with name-rev] Junio C Hamano
2019-08-20 19:34       ` Uwe Brauer
2019-08-20 19:57         ` Phil Hord
2019-08-21  7:50           ` Uwe Brauer
2019-08-21 12:37             ` Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blwmmcbp.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=alban.gruin@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rafa.almas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).