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

Re: [PATCH] rev-list: honor --abbrev=<n> when doing --pretty=oneline

From
EWEric Wong <normalperson@yhbt.net>
Date
Apr 7, 2006, 03:13 UTC
Message-ID
<20060407031356.GA25525@hand.yhbt.net>
In-Reply-To
<7v64lmuqa5.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 27 quoted lines
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > Note that --abbrev=DEFAULT_ABBREV was on by default before, but
> > it only affected the printing of the Merge: header).  Let me
> > know if anybody doesn't want the default behavior to change.
> 
> I've never felt need for abbreviating commit object names, so I
> only had the abbrev variable to determine how the merge parents
> are shown.  If you want to abbreviate the commit object names as
> well, you _could_ do independent precision for parents and
> commits, but that would be overkil.  So I'd rather see a switch
> to turn abbreviation for commits on, perhaps like this:
> 
>         $ git-rev-list --pretty=oneline --abbrev-commit -n 3 master
>         454a35b Add documentation for git-imap-send.
>         ba3c937 blame.c: fix completely broken ancestry traversal.
>         6cbd5d7 Tweaks to make asciidoc play nice.
> 
>         $ git-rev-list --pretty=oneline --abbrev=4 --abbrev-commit -n 3 master
>         454a Add documentation for git-imap-send.
>         ba3c9 blame.c: fix completely broken ancestry traversal.
>         6cbd5 Tweaks to make asciidoc play nice.
> 
> Otherwise you might break Porcelains and people's scripts that
> read from --pretty or --header output.
> 
> -- >8 --

Sounds good, I like your patch. I'm not thrilled with the length of the '--abbrev-commit' switch, but I guess that's what aliases are for :>

-- 
Eric Wong
Previous: Junio C Hamano
Message 3 of 3 in “rev-list: honor --abbrev=<n> when doing --pretty=oneline”
  1. rev-list: honor --abbrev=<n> when doing --pretty=onelineEric Wong, Apr 7, 2006
  2. Junio C HamanoApr 7, 2006
  3. Eric WongApr 7, 2006

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.