From: Junio C Hamano <gitster@pobox.com>
To: "Eric Raible" <raible@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>,
"Junio C Hamano" <gitster@pobox.com>,
szeder@ira.uka.de
Subject: Re: PATCH] Documentation: Tweak use case in "git stash save --keep-index"
Date: Mon, 07 Jul 2008 22:39:58 -0700 [thread overview]
Message-ID: <7vlk0dvsr5.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <279b37b20807072218o19dabd97y2c4edc62fb980ca4@mail.gmail.com> (Eric Raible's message of "Mon, 7 Jul 2008 22:18:03 -0700")
"Eric Raible" <raible@gmail.com> writes:
> The documentation suggests using "git stash apply" in the
> --keep-index workflow even though doing so will lead to clutter
> in the stash. And given that the changes are about to be
> committed anyway "git stash pop" is more sensible.
Yeah, I was pondering about this myself. After popping the remaining
part, you would "git add -p" the next batch, the same "stash save -k-i" to
save the remaining bits away, and continue. Will queue.
BUT
It is very likely that in this workflow you would sometimes find that what
you staged (and left in the working tree after "save -k-i") is faulty and
you need to tweak it in place to make it into a good enough shape for
committing. The example probably should talk about what happens.
Editing, testing and committing is fine, but then what? Will the "pop"
wipe that unplanned change you made after "save -k-i" out? (the answer is
no and this is safe, but the reader of the documentaiton needs it
explained)
Also this may be a good way to split an existing commit into five during a
"rebase -i" session, and the example in the documentation might want to
talk about it in that larger picture.
> Documentation/git-stash.txt | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
> index df26901..bf241da 100644
> --- a/Documentation/git-stash.txt
> +++ b/Documentation/git-stash.txt
> @@ -201,9 +201,10 @@ $ git add --patch foo
> $ git stash save --keep-index
> $ build && run tests
> $ git commit -m 'First part'
> -$ git stash apply
> +$ git stash pop
> +... repeat above five steps until one commit remains ...
> $ build && run tests
> -$ git commit -a -m 'Second part'
> +$ git commit foo -m 'Remaining parts'
> ----------------------------------------------------------------
next prev parent reply other threads:[~2008-07-08 5:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 5:18 PATCH] Documentation: Tweak use case in "git stash save --keep-index" Eric Raible
2008-07-08 5:39 ` Junio C Hamano [this message]
2008-07-08 7:40 ` Eric Raible
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=7vlk0dvsr5.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=raible@gmail.com \
--cc=szeder@ira.uka.de \
/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).