From: Marco Costalba <hidden> Date: 2016-06-15 22:44:02
Currently git-stash writes to stderr also if there is nothing to error
out, also it would be very nice ;-) if git 'stash clear command' would
support deleting of only one patch, so as example to write
stg stash clear stash@{0}
To remove only the last added.
------------------ cut --------------------------
From: Marco Costalba <redacted>
Date: Fri, 4 Jan 2008 17:08:01 +0100
Subject: [PATCH] git-stash: avoid writing to stderr when is not an error
Otherwise git-stash is unusable by scripts that check
stderr to detect fail/success of launched command.
Signed-off-by: Marco Costalba <redacted>
---
git-stash.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
@@ -86,7 +86,7 @@ save_stash () {ifno_changesthen-echo>&2'No local changes to save'+echo>'No local changes to save'exit0fitest-f"$GIT_DIR/logs/$ref_stash"||
@@ -99,7 +99,7 @@ save_stash () {gitupdate-ref-m"$stash_msg"$ref_stash$w_commit||die"Cannot save the current status"-printf>&2'Saved working directory and index state "%s"\n'"$stash_msg"+printf>'Saved working directory and index state "%s"\n'"$stash_msg"} have_stash(){
@@ -229,7 +229,7 @@ create)iftest$#-eq0thensave_stash&&-echo>&2'(To restore them type "git stash apply")'&&+echo>'(To restore them type "git stash apply")'&&git-reset--hardelseusage
Currently git-stash writes to stderr also if there is nothing to error
out, also it would be very nice ;-) if git 'stash clear command' would
support deleting of only one patch, so as example to write
stg stash clear stash@{0}
To remove only the last added.
Maybe it should be named 'drop'. 'drop' sounds better than
'clear' for this usage.
git stash drop [<stash>]
Not sure how often such a command would be used though, so
it may not be worth it.
-brandon
Not sure how often such a command would be used though, so
it may not be worth it.
I've missed it many times. Especially in some scripts when I want to use
the stash-stack to store current working tree and clear it before
exiting. This is not possible today as all the stash-stack would be cleared.
I agree that drop seems better.
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
From: Jakub Narebski <hidden> Date: 2016-06-15 22:44:02
Pascal Obry [off-list ref] writes:
Brandon Casey a écrit :
quoted
Not sure how often such a command would be used though, so
it may not be worth it.
I've missed it many times. Especially in some scripts when I want to use
the stash-stack to store current working tree and clear it before
exiting. This is not possible today as all the stash-stack would be cleared.
I agree that drop seems better.
or "git stash delete"
This probably would require the command to delete single reflog,
which was posted some time ago and is in either pu or in offcuts,
or in next.
But I guess this is post 1.5.4
--
Jakub Narebski
Poland
ShadeHawk on #git
From: Brian Swetland <hidden> Date: 2016-06-15 22:44:02
[Jakub Narebski [off-list ref]]
Pascal Obry [off-list ref] writes:
quoted
Brandon Casey a écrit :
quoted
Not sure how often such a command would be used though, so
it may not be worth it.
I've missed it many times. Especially in some scripts when I want to use
the stash-stack to store current working tree and clear it before
exiting. This is not possible today as all the stash-stack would be cleared.
I agree that drop seems better.
or "git stash delete"
Something like drop or delete would be nice.
I tried to "clear" a single stash once. Oops!
Is there a reason that git stash apply couldn't take a small integer
as the argument (at least as an alternative) instead of stash@{0}, etc?
Brian
From: Jeff King <hidden> Date: 2016-06-15 22:44:02
On Fri, Jan 04, 2008 at 09:51:05AM -0800, Jakub Narebski wrote:
or "git stash delete"
This probably would require the command to delete single reflog,
which was posted some time ago and is in either pu or in offcuts,
or in next.
But I guess this is post 1.5.4
There is a "git reflog delete" in next (but not in master). See
552cecc2. Using the same name makes sense, since they are equivalent
actions (and "git stash delete" should be very easy, since it is
implemented in terms of reflogs).
-Peff
From: Wayne Davison <hidden> Date: 2016-06-15 22:44:02
On Fri, Jan 04, 2008 at 05:14:42PM +0100, Marco Costalba wrote:
- echo >&2 'No local changes to save'
+ echo > 'No local changes to save'
That change and the other two following it each put a newline in a
strangely named file. You should just drop the >&2 altogether if you
want the output to go to stdout.
..wayne..