From: Duy Nguyen Date: Tue, 13 Aug 2013 15:13:48 GMT Subject: Re: ephemeral-branches instead of detached-head? Message-ID: In-Reply-To: On Tue, Aug 13, 2013 at 9:44 PM, David Jeske wrote: > On Aug 12, 2013 11:06 PM, "Duy Nguyen" wrote: >> >> On Mon, Aug 12, 2013 at 3:37 PM, David Jeske 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? > > Any commit which I did not explicitly do something with. (Merge, rebase, > amend, branch name, discard) > > Today every one of those actions is explicit except discard. So basically everything that is (1) produced by "git commit", (2) not connected to any ref and (3) not an amend. I think (1) and (3) can be achieved with "git log -g --grep-reflog commit: HEAD". We only need to filter out ones that are connected to some ref. Not sure if that can be done with script though. Maybe add "--dangling" to "git log -g" to do such filtering? -- Duy