Re: [PATCH] git-stash: add new 'drop' subcommand
- From
Brandon Casey <drafnel@gmail.com>
- Date
- Jan 5, 2008, 05:46 UTC
- Message-ID
- <loom.20080105T053356-853@post.gmane.org>
- In-Reply-To
- <7vtzltf3gg.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster <at> pobox.com> writes:
Show 9 quoted lines
>
> Brandon Casey <casey <at> nrlssc.navy.mil> writes:
>
> > I'm not sure if there is a proper way to get 'stash@{0}' from
> > 'refs/stash' so I kept my usage of that former string outside
> > of the drop_stash() function.
>
> Doesn't "$refs_stash@{0}" (which would give refs/stash@{0} not
> stash@{0}) work for you?yep that works. much nicer.
Show 5 quoted lines
> > diff --git a/git-stash.sh b/git-stash.sh > > -USAGE='[ | save | list | show | apply | clear | create ]' > > +USAGE='[ | save | list | show | apply | clear | create | drop ]' > > Might want to put drop next to clear, but that is minor.
no problem.
> > + git reflog delete "$@" && echo "Dropped $@ ($s)" || > > The second $@ is inconsistent with the next line's use of $*; intentional?
not intentional.
Show 8 quoted lines
> > + set -- "stash@{0}"
> > + fi
> > + drop_stash "$@" &&
> > + (git rev-parse --verify "stash@{0}" > /dev/null 2>&1 || clear_stash)
>
> Curious.
>
> (1) Why not do the clearing inside drop_stash?only because I didn't like stash@{0} notation and didn't want it buried inside a function.
> > (2) Why is clearning necessary in the first place (iow, > shouldn't "reflog delete" take care of that)?
clear_stash additionally deletes refs/stash and logs/refs/stash at least.
-brandon