git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] git-stash: use git rev-parse -q
Date: Mon, 8 Dec 2008 00:17:23 +0100	[thread overview]
Message-ID: <20081207231723.GA5068@atjola.homenet> (raw)
In-Reply-To: <1228179369-3766-1-git-send-email-vmiklos@frugalware.org>

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@frugalware.org>
> ---
>  
>  	# 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

  reply	other threads:[~2008-12-07 23:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02  0:56 [PATCH] git-stash: use git rev-parse -q Miklos Vajna
2008-12-07 23:17 ` Björn Steinbrink [this message]
2008-12-08  1:42   ` Junio C Hamano
2008-12-08  8:46     ` Miklos Vajna

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=20081207231723.GA5068@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=vmiklos@frugalware.org \
    /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).