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

Re: Feature suggestion: git-hist

From
H.Merijn Brand <h.m.brand@xs4all.nl>
Date
Jul 30, 2008, 15:03 UTC
Message-ID
<20080730170326.6f4f1772@pc09.procura.nl>
In-Reply-To
<20080730145534.GD32057@genesis.frugalware.org>

On Wed, 30 Jul 2008 16:55:34 +0200, Miklos Vajna <vmiklos@frugalware.org> wrote:

Show 7 quoted lines
> On Wed, Jul 30, 2008 at 03:58:35PM +0200, "H.Merijn Brand" <h.m.brand@xs4all.nl> wrote:
> > We are not used to working with $SHA's, and IMHO from the end-user pov,
> > a $SHA is less user friendly than a release number or a file version. I
> > can remember a version, but I cannot remember a SHA.
> 
> But a version is never unique in a distributed environment. So a version
> is useless without at least an abbreviated hash.
Which is exactly what my git-hist does:

# git-hist *pm | perl -ne'63..83 and print' 09d4472 2007-12-06 13:25:58 63: allow_loose_quotes => 0, 09d4472 2007-12-06 13:25:58 64: allow_loose_escapes => 0, 09d4472 2007-12-06 13:25:58 65: allow_whitespace => 0, caf4798 2008-02-19 17:56:36 0.34 + 004 66: blank_is_undef => 0, 09d4472 2007-12-06 13:25:58 67: verbatim => 0, 09d4472 2007-12-06 13:25:58 68: types => undef, 09d4472 2007-12-06 13:25:58 69: 8648db0 2008-03-27 18:37:54 0.37 + 002 70: 09d4472 2007-12-06 13:25:58 71: _EOF => 0, 09d4472 2007-12-06 13:25:58 72: _STATUS => undef, 09d4472 2007-12-06 13:25:58 73: _FIELDS => undef, 09d4472 2007-12-06 13:25:58 74: _FFLAGS => undef, 09d4472 2007-12-06 13:25:58 75: _STRING => undef, 09d4472 2007-12-06 13:25:58 76: _ERROR_INPUT => undef, 2b95026 2008-04-04 11:10:09 0.37 + 006 77: _COLUMN_NAMES => undef, ce53d02 2008-04-06 00:40:26 0.37 + 016 78: _BOUND_COLUMNS => undef, 09d4472 2007-12-06 13:25:58 79: ); caf4798 2008-02-19 17:56:36 0.34 + 004 80: my $last_new_err = ""; 09d4472 2007-12-06 13:25:58 81: 09d4472 2007-12-06 13:25:58 82: sub new 09d4472 2007-12-06 13:25:58 83: {

> If pure hashes are not friendly enough, you can use something like:
> 
> git describe $(git rev-list -1 HEAD -- <file>)
What do I miss here?
> git describe $(git rev-list -1 HEAD -- *pm)
fatal: cannot describe 'c2220c8a544af5cd5419e238eb5f43b1f079ad85'
> to get the _hash_ of the _commit_ (ie. not the version of a file) that
> touched the file last time.

My git-hist is just a perl script that collects the combined information of

	git-log --pretty=format:'%h %ct %s'
	git-show-ref --tags
and	git-blame file
I could also make it a reformatting wrapper over several calls to
	git blame -l file | git name-rev --stdin --tags
Which is probably faster for a single file, but slower on multiple files
-- 
H.Merijn Brand          Amsterdam Perl Mongers  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/
Previous: Miklos VajnaNext: Santi Béjar
Message 7 of 13 in “Feature suggestion: git-hist”
  1. H.Merijn BrandJul 30, 2008
  2. Pieter de BieJul 30, 2008
  3. H.Merijn BrandJul 30, 2008
  4. Lars NoschinskiJul 30, 2008
  5. H.Merijn BrandJul 30, 2008
  6. Miklos VajnaJul 30, 2008
  7. H.Merijn BrandJul 30, 2008
  8. Santi BéjarJul 30, 2008
  9. Avery PennarunJul 30, 2008
  10. Lars NoschinskiJul 30, 2008
  11. Santi BéjarJul 30, 2008
  12. H.Merijn BrandJul 30, 2008
  13. H.Merijn BrandJul 30, 2008

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.