Re: [PATCH v4 1/2] stash: reserve exit status 1 for conflicts
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 4, 2026, 15:21 UTC
- Message-ID
- <xmqq7bl16nzl.fsf@gitster.g>
- In-Reply-To
- <CAHwyqnU2c3T_i0gvkqiPPM7UYr8t5bzynr66iG4Z6YUKqZk1Cg@mail.gmail.com>
Harald Nordgren <haraldnordgren@gmail.com> writes:
Show 11 quoted lines
>> A local "make style" while you develop runs >> >> git clang-format --style file --diff --extensions c,h >> >> which tells the command to check only the parts of the system that >> you touched. >> >> I do not think it is used in CI. > > It seems to run as part of CI and doesn't catch it then: > '.github/workflows/check-style.yml'
I never make any pull request to this project, so I didn't even notice its existence.
My question was more about what is in .clang-format file we already have and if it would have caught this. I was actually hoping that "RemoveBracesLLVM: true" we have at the end, which is explained like so
# Remove optional braces of control statements (if, else, for, and while)
# according to the LLVM coding style. This avoids braces on simple
# single-statement bodies of statements but keeps braces if one side of
# if/else if/.../else cascade has multi-statement body.would help us, but it only can do a small subset of what we want, i.e., excess braces around both or either if/else body are removed (see [*] below), and it cannot add braces around all the bodies of if/else if.../else cascade only when one of them require them, it seems.
[*] effect of RemoveBracesLLVM.
git clang-format --style file --diff --extensions c,h
diff --git a/git.c b/git.c index dfd62d4010..c8df287d70 100644 --- a/git.c +++ b/git.c @@ -61,11 +61,10 @@ static void exclude_helpers_from_list(struct string_list *list) size_t i = 0; while (i < list->nr) { - if (strstr(list->items[i].string, "--")) { + if (strstr(list->items[i].string, "--")) unsorted_string_list_delete_item(list, i, 0); - } else { + else i++; - } } } make: *** [Makefile:3503: style] Error 1