From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: しらいしななこ <nanako3@bluebottle.com>, GIT <git@vger.kernel.org>
Subject: Re: [PATCH] Add a manual page for git-stash
Date: Sat, 30 Jun 2007 18:56:02 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0706301853400.4438@racer.site> (raw)
In-Reply-To: <7vps3dcp76.fsf@assigned-by-dhcp.cox.net>
Hi,
On Sat, 30 Jun 2007, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > +DESCRIPTION
> > +-----------
> > +Use 'git stash' when you want to record the current state of the
> > +working directory and the index, but want to go back to a clean
> > +working directory.
> > +
> > +For example, if you have to pull, but are in the middle of some
> > +interesting work, not yet ready to be committed, use git-stash.
> > +
> > +The default operation (when called without options), is to save
> > +the changes away.
> > +
> > +
> > +OPTIONS
> > +-------
> > +clear::
> > + Undo _all_ stashes (dangerous!).
> > +
> > +list [<stashname>]::
> > + List all stashed states.
> > +
>
> I suspect that is not what the implementation intends to do.
> "list -n 4", "list --since=1.hour" would make sense, but "list
> stash@{12}" would probably not.
Okay, I misunderstood the _intention_ of the code, then.
> > +show [<stashname>]::
> > + Show a combined diff of the stashed working directory, index and
> > + HEAD.
>
> Is that what it does? I had an impression that "show stash@{2}"
> shows a regular diff between the base and the stashed working
> tree state.
Ah, you're completely right! Somehow my tired eyes read what I expected to
find there.
> > +apply [<stashname>]::
> > + Try to apply the stashed changes to the current HEAD. You need
> > + a clean working directory for that, i.e. you must not have changes
> > + relative to HEAD in your working directory or index.
>
> The implementation appears to apply on a clean index without
> restriction to where the HEAD is. I hinted that that behaviour
> is fine in my previous message, but on the other hand haven't
> convinced myself enough to say that it would not confuse end
> users. Maybe insisting on not just clean index but no changes
> from the HEAD would reduce confusion? I dunno.
I am sure confused why the index state is stashed away when it is not
used...
> > +<stashname>::
> > + A name of a stashed state. Typically something like 'stash@{2}'
> > + or 'stash@{2.days.ago}'.
>
> Probably this should be defined in DESCRIPTION, along with the
> definition of what a stash is ("records the difference between
> the HEAD when the stash was created and the working tree state
> in such a way that it can be applied to a different state
> later").
Okay.
> > +DISCUSSION
> > +----------
> > +
> > +The state is saved as three commits:
> > +
> > +- HEAD,
> > +- a commit which contains the state of the index, which has HEAD as a
> > + parent, and
> > +- a commit which contains the state of the working directory (only the
> > + tracked files, though), which has both HEAD and the second commit
> > + as parents.
> > +
> > +The third commit holds the complete information of the stash, and is
> > +stored as the ref 'refs/stash'.
> > +
> > +Since that commit does not have any reference to other stashed states,
> > +the stash listing relies on the reflog of 'refs/stash'. Therefore,
> > +the stashed states are garbage collected like all the other reflogs.
>
> Nit; s/the other reflogs/the other reflog entries/
Okay.
> > +Author
> > +------
> > +Written by Johannes E. Schindelin <johannes.schindelin@gmx.de>
>
> You wrote that ;-)?
No. ;-)
Hey, be nice. It's a new role for me, usually others document what _I_
wrote, not vice versa :-)
Ciao,
Dscho
next prev parent reply other threads:[~2007-06-30 17:56 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-30 1:29 [PATCH (2nd try)] Add git-stash script しらいしななこ
2007-06-30 2:05 ` Johannes Schindelin
2007-06-30 5:37 ` [PATCH (3rd " しらいしななこ
2007-06-30 6:12 ` Jeff King
2007-06-30 6:25 ` Junio C Hamano
2007-06-30 15:41 ` Johannes Schindelin
2007-06-30 17:19 ` Junio C Hamano
2007-06-30 23:27 ` しらいしななこ
2007-06-30 15:44 ` [PATCH] Add a manual page for git-stash Johannes Schindelin
2007-06-30 16:38 ` Frank Lichtenheld
2007-06-30 17:48 ` Johannes Schindelin
2007-06-30 18:45 ` Frank Lichtenheld
2007-06-30 17:44 ` Junio C Hamano
2007-06-30 17:56 ` Johannes Schindelin [this message]
2007-06-30 18:13 ` Junio C Hamano
2007-06-30 18:44 ` Johannes Schindelin
2007-07-01 5:26 ` [PATCH] Document git-stash しらいしななこ
2007-07-01 6:48 ` Junio C Hamano
2007-07-01 8:07 ` Jeff King
2007-07-01 8:38 ` Junio C Hamano
2007-07-01 9:06 ` しらいしななこ
[not found] ` <200707010910.l619A23c027837@mi0.bluebottle.com>
2007-07-01 9:19 ` Jeff King
2007-07-01 21:39 ` Junio C Hamano
2007-07-02 4:08 ` Jeff King
2007-07-01 21:54 ` Junio C Hamano
2007-07-01 22:57 ` Johannes Schindelin
2007-07-02 4:10 ` Jeff King
2007-07-02 10:33 ` Johannes Schindelin
2007-07-02 10:44 ` [PATCH] git-stash: Make "save" the default operation again Johannes Schindelin
2007-07-02 11:00 ` Jeff King
2007-07-02 11:15 ` Johannes Schindelin
2007-07-02 23:11 ` Junio C Hamano
2007-07-01 5:20 ` [PATCH] Add a manual page for git-stash Junio C Hamano
2007-06-30 16:06 ` [PATCH] Add tests " 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.0706301853400.4438@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nanako3@bluebottle.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).