From: Sitaram Chamarty <sitaramc@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Duy Nguyen <pclouds@gmail.com>, David Jeske <davidj@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: ephemeral-branches instead of detached-head?
Date: Wed, 14 Aug 2013 05:34:56 +0530 [thread overview]
Message-ID: <520AC9A8.4030104@gmail.com> (raw)
In-Reply-To: <7vk3jpy1qt.fsf@alter.siamese.dyndns.org>
On 08/13/2013 10:19 PM, Junio C Hamano wrote:
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> On Mon, Aug 12, 2013 at 3:37 PM, David Jeske <davidj@gmail.com> wrote:
>>> Is there currently any way to say "hey, git, show me what commits are
>>> dangling that might be lost in the reflog?"
>>
>> How do you define dangling commits? When you do "git commit --amend",
>> the current commit will become dangling (in the sense that it's not
>> referred by any ref, but the commit exists) and those are just noise
>> in my opinion.
>
> "fsck lost-and-found" would be one way. It would be nice if we had
> something like (note: the following will _NOT_ work)
>
> git log -g HEAD --not --branches
>
> to say "walk the reflog of HEAD, but exclude anything that can be
> reached from the tips of branches".
I've been using the following 3 aliases for some time now, to find
various dangling stuff. The middle one (d1) seems to do approximately
what you want, but will probably fail on repos with lots of activity
when the command line length limit is (b)reached.
# all stashed entries (since they don't chain)
sk = !gitk --date-order $(git stash list | cut -d: -f1) --not --branches --tags --remotes
# all reflog entries that are not on a branch, tag, or remote
d1 = !gitk --date-order $(git log -g --pretty=%H) --not --branches --tags --remotes
# all dangling commits not on a branch, tag, or remote
d2 = !gitk --date-order $(git fsck | grep "dangling.commit" | cut -f3 -d' ') --not --branches --tags --remotes
(Apologies if something like this was already said; I was not following
the discussion closely enough to notice)
next prev parent reply other threads:[~2013-08-14 0:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 7:25 ephemeral-branches instead of detached-head? David Jeske
2013-08-12 7:39 ` Jonathan Nieder
2013-08-12 7:55 ` Junio C Hamano
2013-08-12 8:37 ` David Jeske
2013-08-12 12:14 ` David Jeske
2013-08-12 13:23 ` Duy Nguyen
2013-08-12 17:04 ` Andreas Schwab
2013-08-12 17:24 ` Junio C Hamano
2013-08-12 19:40 ` David Jeske
2013-08-12 19:05 ` David Jeske
2013-08-12 17:22 ` Junio C Hamano
2013-08-13 6:05 ` Duy Nguyen
[not found] ` <CA+CP9O5Ak3YD60--Mj+eLv3qzbZuuwTN-AxY3xb=SciKD=uZoQ@mail.gmail.com>
2013-08-13 15:13 ` Duy Nguyen
2013-08-13 15:36 ` Fwd: " David Jeske
2013-08-13 16:58 ` Junio C Hamano
2013-08-13 17:13 ` Junio C Hamano
2013-08-13 16:49 ` Junio C Hamano
2013-08-14 0:04 ` Sitaram Chamarty [this message]
2013-08-14 1:44 ` Junio C Hamano
2013-08-14 6:32 ` Sitaram Chamarty
2013-08-14 6:59 ` Jeff King
2013-08-14 7:10 ` Andres Perera
2013-08-14 9:05 ` Sitaram Chamarty
2013-08-14 16:40 ` Andres Perera
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=520AC9A8.4030104@gmail.com \
--to=sitaramc@gmail.com \
--cc=davidj@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
/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).