Re: [PATCH (3rd try)] Add git-stash script
- From
しらいしななこ <nanako3@bluebottle.com>
- Date
- Jun 30, 2007, 23:27 UTC
- Message-ID
- <200706302327.l5UNRMta027974@mi0.bluebottle.com>
- In-Reply-To
- <Pine.LNX.4.64.0706301641000.4438@racer.site>
Quoting Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> Hi,
Hello.
Show 7 quoted lines
> On Sat, 30 Jun 2007, しらいしななこ wrote: > >> diff --git a/git-stash.sh b/git-stash.sh >> [...] >> + printf >&2 'Saved WIP on %s\n' "$msg" > > You have an awful lot of printfs in the code. Why not just use echos?
I just imitated other scripts. I can change it to
echo >&2 "Saved WIP on $msg"
but after reading Junio's comments, I think I probably should not.
>> +list_stash () {
>> + git-log --pretty=oneline -g "$@" $ref_stash |
>
> Wouldn't you want "--default $ref_stash" here?I do not know, and I'm sorry I do not understand Junio's comments.
What does --default do in this case?
Show 6 quoted lines
>> +apply_stash () {
>> + git-diff-files --quiet ||
>> + die 'Cannot restore on top of a dirty state'
>
> You meant "no_changes", right? I think you miss changes in the index
> otherwise.After I read exchanges between you and Junio I do not know which way is preferred. Using no_changes does not forbid me from doing that, but I think Junio's example will be forbidden. The original scenario was that I apply a stashed change to an unmodified state, and there is no problem either way.
-- Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/ ---------------------------------------------------------------------- Free pop3 email with a spam filter. http://www.bluebottle.com