All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] reflog: ignore expire-unreachable for "HEAD" reflog
Date: Thu, 15 Apr 2010 09:49:51 -0700	[thread overview]
Message-ID: <7vljcok6ds.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4BC70D75.70801@viscovery.net> (Johannes Sixt's message of "Thu\, 15 Apr 2010 14\:58\:29 +0200")

Johannes Sixt <j.sixt@viscovery.net> writes:

> But I don't see yet, why an entry pointing to a dead-end experiment is
> less important when it is an entry in a branch reflog than when it is an
> entry in the HEAD reflog. Care to explain?

You can set both expiry criteria to the same timestamp, unless you feel
"dead-end experiment is _more_ important", so I frankly don't see a strong
need to explain.  The two expiry setting came from the discussion in:

  http://thread.gmane.org/gmane.comp.version-control.git/34653/focus=34734

I can understand the "Oh, I made a commit that adds a huge garbage blob by
mistake---I want to get rid of it from my odb" use case.  It may go like
this:

    # starting from master
    git checkout maint ; did something
    git checkout next ; did something
    git checkout master
    git add huge-gunk ; git commit ; oops
    git reset --hard HEAD^

    git gc --expire-unreachable=now

In the current behaviour, HEAD reflog loses everything that is not
reachable from the current tip, just like the reflog for ordinary
branches.  You would lose the last pointer to the commit made by mistake
and the huge blob will immediately be kicked out from the odb.

But then I have to lose the record that I was working on 'next' before
coming to master, while I still have the record that says I was on
'maint'.  That is what "git checkout -" (and git log -g HEAD) will give us
after the above sequence.  I cannot explain how that could possibly be a
sane behaviour to the users.

It would be nicer to lose entries that talk about commits that do not
appear in history of any ref, and we can have the best of both worlds.
The patch does not do that, but it should be easy to implement.  Instead
of marking from the tip of the ref that the reflog we are expiring is for,
when expiring HEAD reflog, you would mark from the tips of _all_ the refs
(and you would need to clean up afterwards the same way).

      parent reply	other threads:[~2010-04-15 16:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 20:34 [PATCH 1/2] Document gc.<pattern>.reflogexpire variables Junio C Hamano
2010-04-14 20:35 ` [PATCH 2/2] reflog: ignore expire-unreachable for "HEAD" reflog Junio C Hamano
2010-04-15  6:45   ` Johannes Sixt
2010-04-15  7:40     ` Junio C Hamano
2010-04-15  8:49       ` Johannes Sixt
2010-04-15 12:30         ` Junio C Hamano
2010-04-15 12:58           ` Johannes Sixt
2010-04-15 16:36             ` Jeff King
2010-04-15 16:57               ` Junio C Hamano
2010-04-15 19:48                 ` Nicolas Pitre
2010-04-15 22:42                   ` Junio C Hamano
2010-04-16  1:11                     ` Nicolas Pitre
2010-04-16  1:37                       ` Junio C Hamano
2010-04-16  3:07                         ` Nicolas Pitre
2010-04-16  6:08               ` Johannes Sixt
2010-04-15 16:49             ` Junio C Hamano [this message]

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=7vljcok6ds.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.