Subject: Re: ephemeral-branches instead of detached-head?

From: Junio C Hamano <[email-masked]>
Date: Tue, 13 Aug 2013 18:44:08 -0700

Sitaram Chamarty <[email-masked]> writes:

>     # 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)

Yup.

A potential problem is that the output from "log -g --pretty=%H" or
"fsck | grep dangling" may turn out to be humongous.  Other than
that, they correctly compute what you want.