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

Re: [PATCH] commit: Remove backward goto in read_craft_line()

From
Ralf Thielow <ralf.thielow@googlemail.com>
Date
Dec 1, 2010, 21:40 UTC
Message-ID
<AANLkTikoh01_gQAZ3Js4cTfdRioKrR6GHAPDBvUOZm8P@mail.gmail.com>
In-Reply-To
<7vwrnttcm3.fsf@alter.siamese.dyndns.org>

I remember about a peoble (not on this project) who sad that also a little change like this should includes in the sources because it's make the code better without fixing a bug or add a new feature. But in my experience these patches are not very popular. But sure, I understand your reasons, Junio. The statement from above is not even true.

2010/12/1 Junio C Hamano <gitster@pobox.com>:
Show 48 quoted lines
> Ralf Thielow <ralf.thielow@googlemail.com> writes:
>
>>> If "--show-c-function" output is the problem, perhaps we should know a bit
>>> better about what C function header looks like?
>>
>> In fact the "--show-c-function" output is the problem. But I think that
>> a change can't be rejected because of another issue.
>
> Well, I never said anything about rejection nor acceptance.
>
>> The style of placing "goto"-statements, which leave a function to the
>> end of that is used in many other projects. And I think
>> it's very usefull.
>
> It is a good discipline to follow in general to place an exceptional case
> at the end if you jump out of the general flow.  But because the affected
> function was so small, its readability doesn't benefit very much from the
> discipline (in other words, you knew about a good discipline, but applied
> it to a wrong function).  The patch was small and obviously correct, so it
> will not hurt, but it will not make the world greatly a better place,
> either.
>
> IOW, it was a "Meh" topic for me.
>
> It was more important to discuss Jonathan's "leave SP at the beginning of
> a goto label to please --show-c-function" from the maintainer's point of
> view, as people may remember it as a rule and start sending patches that
> follow it, which I will need to deal with in the future.  I do not think
> that one is a good rule.
>
> Now that we have dealt with that more important business of letting people
> know that protecting goto labels with a leading SP is _not_ the rule ;-),
> I am happy with this discussion.
>
> And often I forget about the original issue when a discussion reaches this
> stage of happiness.  So thanks for reminding me.
>
> As I said, even though I do not think the particular function you touched
> badly needs the discipline applied, it would not hurt, and it obviously is
> the right thing to do (iow, if the function were written from day one in a
> way your patch reorganized it, we would never accept a patch to change it
> into today's shape of jumping backwards).  For one thing, it would remove
> an example from the codebase people can point at to make excuses when
> responding to a review of their patch that adds a backward goto to a much
> larger function.
>
> Will queue after massaging the log message somewhat.  Thanks.
>
Previous: Junio C Hamano
Message 8 of 8 in “commit: Remove backward goto in read_craft_line()”
  1. commit: Remove backward goto in read_craft_line()Ralf Thielow, Dec 1, 2010
  2. Jonathan NiederDec 1, 2010
  3. Junio C HamanoDec 1, 2010
  4. Jonathan NiederDec 1, 2010
  5. Ralf ThielowDec 1, 2010
  6. Trivial patches (Re: [PATCH] commit: Remove backward goto in read_craft_line())Jonathan Nieder, Dec 1, 2010
  7. Junio C HamanoDec 1, 2010
  8. Ralf ThielowDec 1, 2010

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.