git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Thomas Rast <trast@student.ethz.ch>, git@vger.kernel.org
Subject: Re: [PATCH] Document 'stash clear' recovery via unreachable commits
Date: Sun, 9 Aug 2009 04:21:35 +0200	[thread overview]
Message-ID: <20090809022134.GA4141@atjola.homenet> (raw)
In-Reply-To: <7veirlbwws.fsf@alter.siamese.dyndns.org>

On 2009.08.08 18:25:55 -0700, Junio C Hamano wrote:
> Thomas Rast <trast@student.ethz.ch> writes:
> 
> > Add an example to the stash documentation that shows how to quickly
> > find candidate commits among the 'git fsck --unreachable' output.
> 
> Thanks.
> 
> > Unless you have merges of branch names containing WIP, or edit your
> > merge messages to say WIP, there will be no false positives.
> 
> That may be true, but I suspect that people's stash entries that are worth
> saving are given their own messages with "git stash save 'message'" and do
> not necessarily say WIP.  I wish if there were a better way to identify
> them, but I do not think of any offhand.

Here's what I have now:

git fsck --unreachable | grep commit | cut -d\  -f3 |
xargs git log --no-walk --merges \
	--grep='^\(WIP on \|On \)\((no branch)\|[^ ]\+\):'

Should catch stashes with and without user-supplied messages and avoid
most false-positives. Drop the "WIP on " option from the grep to capture
just those that have a user-supplied message.

To try really really hard to get stash stuff only, one could add some
extra stuff to verify that the second parent's commit message is
"index on \2:" (\2 being the second group from the above --grep). But
that's probably total overkill...

Björn

  reply	other threads:[~2009-08-09  2:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-09  0:47 [PATCH] Document 'stash clear' recovery via unreachable commits Thomas Rast
2009-08-09  1:25 ` Junio C Hamano
2009-08-09  2:21   ` Björn Steinbrink [this message]
2009-08-09  9:26   ` Sitaram Chamarty

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=20090809022134.GA4141@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@student.ethz.ch \
    /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).