From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Steven Grimm <koreth@midwinter.com>
Cc: "Jean-François Veillette" <jean_francois_veillette@yahoo.ca>,
"Matthieu Moy" <Matthieu.Moy@imag.fr>,
"Junio C Hamano" <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: git-diff on touched files: bug or feature?
Date: Thu, 2 Aug 2007 16:23:38 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0708021614420.14781@racer.site> (raw)
In-Reply-To: <46B1F3F4.5030504@midwinter.com>
Hi,
On Thu, 2 Aug 2007, Steven Grimm wrote:
> Johannes Schindelin wrote:
> > This use case has not much to do with new users. A new user _has_ to know
> > that updating all files, even if their content does not change, is not
> > right.
> >
>
> Someone who has used, say, Subversion might have a perfectly reasonable
> expectation that "git diff" will show differences in content, and when there
> are no differences in content, will not mention a file at all. Other version
> control systems have "diff" commands that ignore touched files.
>
> I admit I also thought the empty diffs were a bug (albeit a minor one not
> worth making noise about) until this thread. Now I understand why it happens,
> though I still think we'd be better off just not displaying the filename in
> git-diff until we know there's an actual diff to display.
>
> I certainly don't think the "it's a feature: it reminds you when you've edited
> a file without changing it" argument holds any water at all. If that were
> truly the intent, if we truly considered that to be useful information a
> developer would want to get at after the fact, then why would git-status throw
> away that information?
Okay, I'll answer just this one, instead of pointing you to the thread
that I've been pointing to twice now (because your ideas about how
git should work are usually similar to mine, and by way of saying thanks
for your contributions):
When is the time to say "git status"?
It is just before committing. I.e when you really think that you're done
editing, and want to have the end picture. "git status" only gives you
names, and therefore it _has_ to update the index if it got out of sync,
to show meaningful results.
When is the time to say "git diff"?
Much more often. In the middle of your work. And there it would be
_disruptive_ if it updated the index all the time, especially if you have
a quite large working tree.
But then, normal users do not touch all the files. They don't.
So I doubt that in the common case the subject we are discussing matters
at all.
Yes, "perl -pi" is something I used myself. Yes, I think it is a bug that
it writes new files when it does not really change anything. And yes, I
had a script lying somewhere on my backup hard disk which uses some evil
"git diff --name-only | xargs bla" mantra (it does not even use the
--quiet option, since that was not invented back then) to actually _undo_
the effects by setting the timestamps back, since the full compilation
time in that project _hurt_.
But it is hardly an operation that I use daily. Hardly even twice a
year.
Ciao,
Dscho
next prev parent reply other threads:[~2007-08-02 15:24 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-01 16:17 git-diff on touched files: bug or feature? Matthieu Moy
2007-08-01 17:26 ` Junio C Hamano
2007-08-01 19:02 ` Alexandre Julliard
2007-08-01 19:07 ` Junio C Hamano
2007-08-01 19:17 ` Alexandre Julliard
2007-08-02 9:23 ` Matthieu Moy
2007-08-02 9:51 ` Johannes Schindelin
2007-08-02 9:57 ` Matthieu Moy
2007-08-02 10:48 ` Johannes Schindelin
2007-08-02 14:04 ` Jean-François Veillette
2007-08-02 14:43 ` Johannes Schindelin
2007-08-02 15:10 ` Steven Grimm
2007-08-02 15:23 ` Johannes Schindelin [this message]
2007-08-02 15:45 ` Matthieu Moy
2007-08-02 17:58 ` J. Bruce Fields
2007-08-03 5:37 ` [PATCH] Add --show-touched option to show "diff --git" line when contents are unchanged Steven Grimm
2007-08-03 6:30 ` Junio C Hamano
2007-08-03 10:23 ` Johannes Schindelin
2007-08-03 20:33 ` Junio C Hamano
2007-08-03 21:32 ` Matthieu Moy
2007-08-03 21:50 ` Junio C Hamano
2007-08-03 23:01 ` Matthieu Moy
2007-08-03 23:36 ` Junio C Hamano
2007-08-05 19:42 ` Matthieu Moy
2007-08-05 19:45 ` Johannes Schindelin
2007-08-05 19:57 ` Matthieu Moy
2007-08-06 15:56 ` Matthias Lederhofer
2007-08-06 16:10 ` David Kastrup
2007-08-06 16:16 ` David Kastrup
2007-08-06 20:05 ` Matthieu Moy
2007-08-06 20:34 ` Junio C Hamano
2007-08-07 6:32 ` David Kastrup
2007-08-07 13:34 ` J. Bruce Fields
2007-08-07 4:22 ` Linus Torvalds
2007-08-07 4:37 ` Junio C Hamano
2007-08-07 6:41 ` David Kastrup
2007-08-08 3:07 ` Linus Torvalds
2007-08-08 3:44 ` Junio C Hamano
2007-08-08 8:26 ` Johannes Schindelin
2007-08-08 8:43 ` Junio C Hamano
2007-08-08 9:13 ` David Kastrup
2007-08-08 9:23 ` Johannes Schindelin
2007-08-08 9:58 ` Jakub Narebski
2007-08-07 5:56 ` Steven Grimm
2007-08-07 5:57 ` [PATCH] Add a note about the index being updated by git-status in some cases Steven Grimm
2007-08-07 6:35 ` [PATCH] git-diff: Output a warning about stale files in the index Steven Grimm
2007-08-07 6:46 ` Junio C Hamano
2007-08-07 7:17 ` [PATCH v2] " Steven Grimm
2007-08-07 7:46 ` Junio C Hamano
2007-08-07 7:51 ` Steven Grimm
2007-08-07 9:04 ` Jakub Narebski
2007-08-11 20:07 ` Junio C Hamano
2007-08-08 3:42 ` [PATCH] Add --show-touched option to show "diff --git" line when contents are unchanged Linus Torvalds
2007-08-07 6:39 ` Steven Grimm
2007-08-07 6:47 ` Matthieu Moy
2007-08-02 20:50 ` git-diff on touched files: bug or feature? Junio C Hamano
2007-08-02 9:54 ` Junio C Hamano
2007-08-02 10:01 ` Junio C Hamano
2007-08-02 12:08 ` Matthieu Moy
2007-08-02 12:21 ` Johannes Schindelin
2007-08-02 19:56 ` Junio C Hamano
2007-08-03 7:04 ` Jeff King
2007-08-03 7:59 ` Junio C Hamano
2007-08-03 8:24 ` Jeff King
2007-08-03 8:57 ` Junio C Hamano
2007-08-03 8:40 ` Shawn O. Pearce
2007-08-03 9:13 ` Junio C Hamano
2007-08-02 12:05 ` Matthieu Moy
2007-08-02 12:19 ` Johannes Schindelin
2007-08-02 12:26 ` Matthieu Moy
2007-08-02 14:39 ` Johannes Schindelin
2007-08-02 14:49 ` Matthieu Moy
2007-08-02 15:12 ` Johannes Schindelin
2007-08-02 13:25 ` Joel Reed
2007-08-02 15:05 ` Johannes Schindelin
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=Pine.LNX.4.64.0708021614420.14781@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jean_francois_veillette@yahoo.ca \
--cc=koreth@midwinter.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.
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 NNTP newsgroup(s).