git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6 5/8] branch: drop non-commit error reporting

From
Karthik Nayak <karthik.188@gmail.com>
Date
Sep 24, 2015, 06:23 UTC
Message-ID
<CAOLa=ZS9oY0E43CqevAroECD40aPj6cmh=eP1qj5GOvjoj_-EQ@mail.gmail.com>
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:
Show 24 quoted lines
> 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.

Show 14 quoted lines
>
> 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.
Show 5 quoted lines
>
> 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
Previous: Junio C HamanoNext: Karthik Nayak
Message 16 of 27 in “port branch.c to use the filtering part of ref-filter.”
  1. 0/8 port branch.c to use the filtering part of ref-filter.Karthik Nayak, Sep 23, 2015
  2. 1/8 branch: refactor width computationKarthik Nayak, Sep 23, 2015
  3. 2/8 branch: bump get_head_description() to the topKarthik Nayak, Sep 23, 2015
  4. 3/8 branch: roll show_detached HEAD into regular ref_listKarthik Nayak, Sep 23, 2015
  5. 4/8 branch: move 'current' check down to the presentation layerKarthik Nayak, Sep 23, 2015
  6. 5/8 branch: drop non-commit error reportingKarthik Nayak, Sep 23, 2015
  7. Matthieu MoySep 23, 2015
  8. Karthik NayakSep 24, 2015
  9. Junio C HamanoSep 23, 2015
  10. Matthieu MoySep 23, 2015
  11. Junio C HamanoSep 23, 2015
  12. Junio C HamanoSep 23, 2015
  13. Junio C HamanoSep 23, 2015
  14. Matthieu MoySep 24, 2015
  15. Junio C HamanoSep 23, 2015
  16. Karthik NayakSep 24, 2015
  17. 6/8 branch.c: use 'ref-filter' data structuresKarthik Nayak, Sep 23, 2015
  18. 7/8 branch.c: use 'ref-filter' APIsKarthik Nayak, Sep 23, 2015
  19. 8/8 branch: add '--points-at' optionKarthik Nayak, Sep 23, 2015
  20. Matthieu MoySep 23, 2015
  21. Junio C HamanoSep 23, 2015
  22. Karthik NayakSep 24, 2015
  23. 5/8 branch: drop non-commit error reportingKarthik Nayak, Sep 24, 2015
  24. Matthieu MoySep 25, 2015
  25. Junio C HamanoSep 25, 2015
  26. Matthieu MoySep 25, 2015
  27. Karthik NayakSep 25, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.