From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, Matthieu Moy <Matthieu.Moy@imag.fr>,
git@vger.kernel.org
Subject: Re: git-diff on touched files: bug or feature?
Date: Fri, 3 Aug 2007 04:40:10 -0400 [thread overview]
Message-ID: <20070803084010.GM20052@spearce.org> (raw)
In-Reply-To: <7vr6mlnj4g.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <gitster@pobox.com> wrote:
> > On Thu, Aug 02, 2007 at 12:56:19PM -0700, Junio C Hamano wrote:
> >
> >> Personally, I almost never run "git status". The command is
> >> there primarily because other systems had a command called
> >> "status", and migrant wondered why we didn't. We do not need
> >> it, and we do not have to use it.
> >
> > So what is the recommended command to summarize which files have been
> > modified, which files have been marked for commit, and which remain
> > untracked?
git-gui? ;-)
I also use the following two aliases:
[alias]
dw = diff --stat --summary
di = diff --stat --summary --cached
...
> I do not make partial commits myself, so
> distinction between staged and unstaged are not something I am
> usually interested in.
I never used to either. Then git-gui got really useful at showing
the distinction and I started using the index for a staging ground.
I almost never make partial commits, unless it is completely trivial,
e.g. a comment fixup that isn't related to what I'm really doing
but that was too darn obvious to not fix _right now_.
But I always toss things into the index when I've read through the
diff a few times and am very happy with it. I may not be done with
the overall commit, but I park the hunks into the index so I don't
have to look at them again. I use a trackball so "tossing into the
index" is really just a flick of the wrist to select the menu item
from the pop-up menu on that hunk. Quite like a toss. ;-)
I tend to test only once I have everything staged into the index and
my working directory is clean (nothing changed that isn't staged).
Its at that point that I think my change is done and I'm happy with
how the diff looks. Usually the code is correct at this point too;
but if its not I'll fix it, then commit.
So where does that leave me regarding the touched but not changed
files? Usually they just get in my way in the end. I don't much
care that I've undone the file back to what I had in the index.
It just doesn't provide any value to my workflow. It is actually
incredible rare that I cause it to happen too. Usually I won't
write the file back to disk if I'm just going to undo it.
If I do write it to disk I'm likely to stage it or at least some
hunks of it. If I later change my mind and undo those changes I'm
going to effectively stage the reverse difference. This is a very
nice hint showing me that yes in fact the older way was better.
Personally? The index is a killer feature for me. Totally.
I can't work without it anymore, it has become a total crutch to me.
You would have to pry the index from my cold dead fingers to get
me to stop using it.
Yea, that is a total about-face for me. I used to think the index
was only useful for merges. Boy was I wrong!
--
Shawn.
next prev parent reply other threads:[~2007-08-03 8:41 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
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 [this message]
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=20070803084010.GM20052@spearce.org \
--to=spearce@spearce.org \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).