git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Greg Hurrell <greg@hurrell.net>
To: git@vger.kernel.org
Subject: Document change in format of raw diff output format
Date: Fri, 23 Nov 2018 10:09:07 +0100	[thread overview]
Message-ID: <20181123090908.43445-1-greg@hurrell.net> (raw)
In-Reply-To: <20181122160154.GA28192@sigill.intra.peff.net>

Jeff King wrote:

> On Thu, Nov 22, 2018 at 11:58:36AM +0100, Greg Hurrell wrote:
> 
> > diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt
> > index 706916c94c..33776459d0 100644
> > --- a/Documentation/diff-format.txt
> > +++ b/Documentation/diff-format.txt
> > @@ -26,12 +26,12 @@ line per changed file.
> >  An output line is formatted this way:
> > 
> >  ------------------------------------------------
> > -in-place edit  :100644 100644 bcd1234... 0123456... M file0
> > -copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2
> > -rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3
> > -create         :000000 100644 0000000... 1234567... A file4
> > -delete         :100644 000000 1234567... 0000000... D file5
> > -unmerged       :000000 000000 0000000... 0000000... U file6
> > +in-place edit  :100644 100644 bcd123456 012345678 M file0
> > +copy-edit      :100644 100644 abcd12345 123456789 C68 file1 file2
> > +rename-edit    :100644 100644 abcd12345 123456789 R86 file1 file3
> > +create         :000000 100644 000000000 123456789 A file4
> > +delete         :100644 000000 123456789 000000000 D file5
> > +unmerged       :000000 000000 000000000 000000000 U file6
> >  ------------------------------------------------
> 
> Yeah, this looks like an improvement.
> 
> I think in general that we'd continue to show 7 characters now, just
> without the extra dots (though it's auto-scaled based on the number of
> objects in the repo these days, so it's not even really a constant).

That's funny. I looked at the output on (what I thought was) a small
repo and it was showing me 9-character abbreviated hashes. I guess I
just got lucky. Tested on a basically empty repo and 7 does look to be
the default.

> PS As you noticed, "git log" we don't promise that git-log output will
>    never change between versions. For machine-consumption you probably
>    want to use plumbing like "git rev-list | git diff-tree --stdin",
>    which produces unabbreviated hashes.

Thanks for the tip. My mistake was thinking that the `--raw` made the
`git log` output somehow more plumbing-ish, but I've gone ahead and
switched to using git-rev-list plus git-diff-tree instead.

Anyway, patch follows.



  reply	other threads:[~2018-11-23  9:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 10:58 Document change in format of raw diff output format Greg Hurrell
2018-11-22 16:01 ` Jeff King
2018-11-23  9:09   ` Greg Hurrell [this message]
2018-11-23  9:09     ` [PATCH] doc: update diff-format.txt for removed ellipses Greg Hurrell
2018-11-24  2:50       ` Junio C Hamano
2018-11-24  9:29         ` [PATCH] doc: update diff-format.txt for removed ellipses in --raw Greg Hurrell
2018-11-26  7:02           ` Junio C Hamano

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=20181123090908.43445-1-greg@hurrell.net \
    --to=greg@hurrell.net \
    --cc=git@vger.kernel.org \
    /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).