From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Neal Kreitzinger <neal@rsss.com>, git@vger.kernel.org
Subject: Re: Can I checkout a single file without altering index?
Date: Fri, 15 Oct 2010 18:40:08 -0500 [thread overview]
Message-ID: <20101015234008.GC25624@burratino> (raw)
In-Reply-To: <7viq13avn0.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> If somebody
> can write a convincing use case that shows why it is useful, such an
> option shouldn't be very hard to add. But I don't think of any. For
> example, this is not it:
>
> I start from a clean slate and start working.
>
> $ git checkout
> $ edit; git diff; compile; test; git add path ;# repeat
>
> At this point I have some cooked contents added for the next commit
> in the index for path. But I realize that the contents of that path
> in another branch might be even better. But I do not want to lose
> the state I arrived at, which might be better than that alternative.
> I cannot decide, so I'll keep that in the index for now.
To be a devil's advocate (because I am not convinced yet), here is one:
I start from a clean slate and start working.
$ git checkout
$ edit; git diff; compile; test; git add path ;# repeat
At this point I have some cooked contents added for the next commit
in the index for path. Illustrating the new change is a new test,
and I want to "test the test" by trying it out against the inferior
previous state.
$ git checkout --no-index HEAD path
$ test; edit test; git diff; compile; test; git add test ;# repeat
Now one last test run with the improved state
$ git checkout path
$ compile; test
$ git commit
prev parent reply other threads:[~2010-10-15 23:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-12 10:03 Can I checkout a single file without altering index? Christian Halstrick
2010-10-12 10:19 ` Michael J Gruber
2010-10-12 11:14 ` Stefan Naewe
2010-10-13 17:09 ` Jared Hance
2010-10-12 15:39 ` Alex Riesen
2010-10-12 16:39 ` Tomas Carnecky
2010-10-14 8:03 ` Christian Halstrick
2010-10-15 18:30 ` Neal Kreitzinger
2010-10-15 18:43 ` Jonathan Nieder
2010-10-15 18:55 ` Jeff King
2010-10-15 19:32 ` Jonathan Nieder
2010-10-15 19:48 ` Jeff King
2010-10-15 18:57 ` Neal Kreitzinger
2010-10-15 19:02 ` Andreas Schwab
2010-10-15 23:22 ` Junio C Hamano
2010-10-15 23:40 ` Jonathan Nieder [this message]
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=20101015234008.GC25624@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=neal@rsss.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.