All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik Nayak <karthik.188@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git <git@vger.kernel.org>,
	Christian Couder <christian.couder@gmail.com>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Subject: Re: [PATCH v6 5/8] branch: drop non-commit error reporting
Date: Thu, 24 Sep 2015 11:53:17 +0530	[thread overview]
Message-ID: <CAOLa=ZS9oY0E43CqevAroECD40aPj6cmh=eP1qj5GOvjoj_-EQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqfv25x80c.fsf@gitster.mtv.corp.google.com>

On Thu, Sep 24, 2015 at 12:44 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>> Remove the error reporting variable to make the code easier to port
>> over to using ref-filter APIs.
>>
>> This also removes the error from being displayed. As branch.c will use
>> ref-filter APIs in the following patches, the error checking becomes
>> redundant with the error reporting system found in the ref-filter
>> (ref-filter.c:1336).
>
> Hmm, do you mean these lines by the above reference?
>
>         if (filter->merge_commit || filter->with_commit) {
>                 commit = lookup_commit_reference_gently(oid->hash, 1);
>                 if (!commit)
>                         return 0;
>
> That is "silently return ignoring it if it is not a commit", i.e.  I
> do not think that deserves to be called error REPORTING system.
>
> Do you really understand what the error message you are removing is
> trying to diagnose?  A branch ref must not point at a blob or any
> non-commit object, and if we find such a branch ref, we report it as
> error.  That is what the error message is about.

What you're saying makes sense, It doesn't reflect the fact that the error
reporting is dropped, rather seems to be substituted by ref-filter.

>
> Now, ref-filter.c:1336 has in no position to issue that same error
> message because it does not know what it is looking at is supposed
> to be a branch ref, so it is WRONG if it gave the same error
> message.  After all, the caller may be using ref-filter to filter
> refs/tags/* with merge_commit or with_commit and found a
> light-weight tag in refs/tags/* that points at a blob.  That is not
> an event we want to get an error at all.
>
> I do not think we terribly mind if this message goes away from this
> location.  "It is a wrong codepath whose purpose is not to diagnose
> and report a repository corruption.  If we care about such a
> repository corruption, we should report it from fsck instead", would
> bea valid justification for the removal of the message.

Seems good, I'll incorporate this into the commit message.

>
> It is not a valid justification to claim that it is made redundant,
> when you actually are simply LOSING the error reporting without
> giving the same error message from another codepath to make it truly
> redundant.

Yes, my bad, Will resend the patch.

-- 
Regards,
Karthik Nayak

  parent reply	other threads:[~2015-09-24  6:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23 18:11 [PATCH v6 0/8] port branch.c to use the filtering part of ref-filter Karthik Nayak
2015-09-23 18:11 ` [PATCH v6 1/8] branch: refactor width computation Karthik Nayak
2015-09-23 18:11 ` [PATCH v6 2/8] branch: bump get_head_description() to the top Karthik Nayak
2015-09-23 18:11 ` [PATCH v6 3/8] branch: roll show_detached HEAD into regular ref_list Karthik Nayak
2015-09-23 18:11 ` [PATCH v6 4/8] branch: move 'current' check down to the presentation layer Karthik Nayak
2015-09-23 18:11 ` [PATCH v6 5/8] branch: drop non-commit error reporting Karthik Nayak
2015-09-23 18:57   ` Matthieu Moy
2015-09-24  6:19     ` Karthik Nayak
2015-09-23 19:14   ` Junio C Hamano
2015-09-23 20:10     ` Matthieu Moy
2015-09-23 20:29       ` Junio C Hamano
2015-09-23 20:38         ` Junio C Hamano
2015-09-23 21:44           ` Junio C Hamano
2015-09-24  6:46             ` Matthieu Moy
2015-09-23 22:50       ` Junio C Hamano
2015-09-24  6:23     ` Karthik Nayak [this message]
2015-09-23 18:11 ` [PATCH v6 6/8] branch.c: use 'ref-filter' data structures Karthik Nayak
2015-09-23 18:11 ` [PATCH v6 7/8] branch.c: use 'ref-filter' APIs Karthik Nayak
2015-09-23 18:11 ` [PATCH v6 8/8] branch: add '--points-at' option Karthik Nayak
2015-09-23 19:00 ` [PATCH v6 0/8] port branch.c to use the filtering part of ref-filter Matthieu Moy
2015-09-23 19:16   ` Junio C Hamano
2015-09-24  6:01     ` Karthik Nayak
2015-09-24 18:09 ` [PATCH v6b 5/8] branch: drop non-commit error reporting Karthik Nayak
2015-09-25  5:55   ` Matthieu Moy
2015-09-25 16:00     ` Junio C Hamano
2015-09-25 16:30       ` Matthieu Moy
2015-09-25 18:37       ` Karthik Nayak

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='CAOLa=ZS9oY0E43CqevAroECD40aPj6cmh=eP1qj5GOvjoj_-EQ@mail.gmail.com' \
    --to=karthik.188@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.