git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Pieter de Bie <pdebie@ai.rug.nl>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Git Mailinglist <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] builtin-reflog: fix deletion of HEAD entries
Date: Sun, 10 Aug 2008 11:52:33 -0700	[thread overview]
Message-ID: <7vej4w3dou.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1218360901-36215-1-git-send-email-pdebie@ai.rug.nl> (Pieter de Bie's message of "Sun, 10 Aug 2008 11:35:01 +0200")

Pieter de Bie <pdebie@ai.rug.nl> writes:

> On Aug 10, 2008, at 3:01 AM, Junio C Hamano wrote:
>>-		if (!dwim_ref(argv[i], spec - argv[i], sha1, &ref)) {
>>+		if (!dwim_log(argv[i], spec - argv[i], sha1, &ref)) {
>
> This is also what add_reflog_for_walk() does, but that function tries to resolve
> the argv[i] part first, without doing the dwim_log().
>
> Perhaps we can also ...

Sorry, I do not understand what you meant by the above comment.

 - "This is also what add_reflog_for_walk() does" -- I take it you mean
   the use of dwim_log() instead of dwim_ref()?

 - "... but that function tries to resolve the argv[i] part first" -- do
   you mean the resolve_ref("HEAD"...) call inside "if (!*branch)"
   codepath?

   That one serves different purposes than "delete HEAD@{42}".  It is
   about showing "@{42}" --- in order to show reflog for "the current
   branch", it figures out the current branch by resolving "HEAD".

In any case, what confuses me is I cannot tell if you do or do not have
issues that I did not think of with the "s/dwim_ref/dwim_log/" change.
Are you saying "no that cannot be a correct fix; see the way dwim_log() is
used in add_reflog_for_walk() -- it does more than your one-liner"?

By the way, I think the idea of "Perhaps we can also..." part is good.

  parent reply	other threads:[~2008-08-10 18:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-09 23:33 [PATCH 1/2] reflog test: add more tests for 'reflog delete' Pieter de Bie
2008-08-09 23:33 ` [PATCH 2/2] builtin-reflog: fix deletion of HEAD entries Pieter de Bie
2008-08-10  0:44   ` Junio C Hamano
2008-08-10  1:01     ` Junio C Hamano
2008-08-10  9:35       ` Pieter de Bie
2008-08-10 11:12         ` Johannes Sixt
2008-08-10 18:52         ` Junio C Hamano [this message]
2008-08-10 19:04           ` Pieter de Bie
2008-08-10 20:22             ` [PATCH] builtin-reflog: Allow reflog expire to name partial ref Pieter de Bie

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=7vej4w3dou.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=pdebie@ai.rug.nl \
    /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).