Re: [PATCH] git-stash: use git rev-parse -q

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2008.12.02 01:56:09 +0100, Miklos Vajna wrote:
> Don't redirect stderr to /dev/null, use -q to suppress the output on
> stderr.
> 
> Signed-off-by: Miklos Vajna <vmiklos@xxxxxxxxxxxxxx>
> ---
>  
>  	# clear_stash if we just dropped the last stash entry
> -	git rev-parse --verify "$ref_stash@{0}" > /dev/null 2>&1 || clear_stash
> +	git rev-parse -q --verify "$ref_stash@{0}" > /dev/null || clear_stash

This one causes an error message to pop up when the last stash entry is
dropped:

doener@atjola:git (master) $ echo 123 >> Makefile

doener@atjola:git (master) $ git stash
Saved working directory and index state "WIP on master: 2dd6202...
Update draft release notes to 1.6.1"
HEAD is now at 2dd6202 Update draft release notes to 1.6.1
(To restore them type "git stash apply")

doener@atjola:git (master) $ git stash drop
Dropped refs/stash@{0} (e692e43ce03fe0b5f0eb94123123ea61a0f2097a)
fatal: Log .git/logs/refs/stash is empty.

git version 1.6.1.rc1.56.g2dd62

After "git stash drop" finished the rev-parse won't complain anymore,
even if you recreate an empty .git/logs/refs/stash file, because
.git/refs/stash is also gone, and then it doesn't seem to care anymore.

But having a valid ref and an empty log makes it unhappy:

doener@atjola:git (master) $ git rev-parse HEAD > .git/refs/stash
doener@atjola:git (master) $ : > .git/logs/refs/stash
doener@atjola:git (master) $ git rev-parse -q --verify 'refs/stash@{1}'
fatal: Log .git/logs/refs/stash is empty.

Björn
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux