From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Sebastian Schuberth <sschuberth@gmail•com>,
Git Mailing List <git@vger•kernel.org>
Subject: Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet
Date: Thu, 23 Jul 2015 12:39:52 -0700 [thread overview]
Message-ID: <xmqq4mkupss7.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150723180846.GB18686@peff.net> (Jeff King's message of "Thu, 23 Jul 2015 11:08:46 -0700")
Jeff King <peff@peff•net> writes:
> I have not been following the thread closely, but I do not recall seeing
> anyone mention that the reason for the sha1-output is handing
> only a single commit-ish to diff-tree is what puts it into its log-like
> mode. Actually asking for a two-endpoint tree diff:
>
> git diff-tree --quiet --ignore-space-change $commit^ $commit
>
> will do what you want.
Yeah, if we were living in an ideal world equipped with a time
machine, I would redesign "git diff-tree $commit" so that it does
not show the commit object name in its output at all, with or
without "--quiet".
In "git rev-list ... | git diff-tree --stdin" output, the commit
object name is absolutely necessary, with or without --quiet, as it
serves as the sign that the output switched to talk about a
different commit.
But the case that feeds a single commit to the command, used as a
poor-man's "git show $commit", does not need one---the caller knows
exactly which commit the output is about.
It is an unfortunate historical accident that a single commit usage
is defined to be a degenerate case of feeding a sequence of commits
to the command and the length of the sequence happens to be one.
"diff-tree $commit" could instead have been defined as a short-hand
for "diff-tree $commit^ $commit", but (1) we do not live in an ideal
world, and (2) it ignores $commit^2 and later parents.
This is a tangent, but I suspect that the current implementation of
"diff-tree --stdin --quiet" may be buggy and does not consistently
show the commits that touch the given path.
$ git rev-list master..jc/rerere | git diff-tree --stdin -s rerere.h
gives what is expected (shows the commit object names, but being
silent on the differences), while s/-s/--quiet/ seems to omit every
other commit from the output, or something silly like that.
I haven't dug into why that happens, but possible ways to fix that
are to make "--quiet" output all (making it consistent with "-s") or
no (making the command totally silent) output at all ;-).
next prev parent reply other threads:[~2015-07-23 19:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 9:29 [PATCH] diff-tree: do not show the sha1 of the given head with --quiet Sebastian Schuberth
2015-07-22 11:42 ` Johannes Schindelin
2015-07-22 11:56 ` [PATCH v2] " Sebastian Schuberth
2015-07-22 20:32 ` [PATCH] " Junio C Hamano
2015-07-23 7:06 ` Sebastian Schuberth
2015-07-23 16:38 ` Junio C Hamano
2015-07-23 17:06 ` Junio C Hamano
2015-07-23 20:13 ` Sebastian Schuberth
2015-07-23 18:08 ` Jeff King
2015-07-23 19:39 ` Junio C Hamano [this message]
2015-07-23 20:19 ` Sebastian Schuberth
2015-07-23 20:43 ` Junio C Hamano
2015-07-23 20:02 ` Sebastian Schuberth
2015-07-24 6:56 ` Jeff King
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4mkupss7.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=peff@peff$(echo .)net \
--cc=sschuberth@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox