git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: git@vger.kernel.org
Subject: git rev-list --all --reflog does not include worktree references
Date: Mon, 05 Oct 2015 21:08:19 +0200	[thread overview]
Message-ID: <87io6l16cc.fsf@igel.home> (raw)

When running git rev-list --all --reflog in the main worktree it doesn't
include commits only referenced by the worktrees, neither HEAD nor its
reflog.

$ git init test
$ cd test
# add some commits
$ touch 1; git add 1; git commit -m 1
$ touch 2; git add 2; git commit -m 2
# add new worktree
$ git worktree add ../test2 master^{}
$ cd ../test2
# add more commits
$ touch 3; git add 3; git commit -m 3
$ touch 4; git add 4; git commit -m 4
# create an unreferenced commit
$ git checkout @^
# both commands should give the same number of commits
$ git rev-list --reflog | wc -l
4
$ git -C ../test rev-list --all --reflog | wc -l
2

IIUC this will cause git gc to prune references from worktrees too
early.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

             reply	other threads:[~2015-10-05 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 19:08 Andreas Schwab [this message]
2015-10-06  9:39 ` git rev-list --all --reflog does not include worktree references Michael J Gruber

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=87io6l16cc.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=git@vger.kernel.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).