name-rev: run clang-format before factoring code

We are about to move code around to prepare for adding a new command. Let’s deal with clang-format changes first in the affected areas. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kristoffer Haugsbakk committed May 11, 2026 at 17:45 UTC b9c1be43eb30084570781569920a92799afdceaf
1 file changed +9 -9
builtin/name-rev.c
+9 -9
@@ -519,22 +519,22 @@ static void name_rev_line(char *p, struct name_ref_data *data)
519 if (!ishex(*p)) {
520 counter = 0;
521 } else if (++counter == hexsz &&
522 - !ishex(*(p+1))) {
522 + !ishex(*(p + 1))) {
523 struct object_id oid;
524 const char *name = NULL;
525 - char c = *(p+1);
525 + char c = *(p + 1);
526 int p_len = p - p_start + 1;
527
528 counter = 0;
529
530 - *(p+1) = 0;
530 + *(p + 1) = 0;
531 if (!repo_get_oid(the_repository, p - (hexsz - 1), &oid)) {
532 struct object *o =
533 lookup_object(the_repository, &oid);
534 if (o)
535 name = get_rev_name(o, &buf);
536 }
537 - *(p+1) = c;
537 + *(p + 1) = c;
538
539 if (!name)
540 continue;
@@ -571,9 +571,9 @@ int cmd_name_rev(int argc,
571 OPT_BOOL(0, "name-only", &data.name_only, N_("print only ref-based names (no object names)")),
572 OPT_BOOL(0, "tags", &data.tags_only, N_("only use tags to name the commits")),
573 OPT_STRING_LIST(0, "refs", &data.ref_filters, N_("pattern"),
574 - N_("only use refs matching <pattern>")),
574 + N_("only use refs matching <pattern>")),
575 OPT_STRING_LIST(0, "exclude", &data.exclude_filters, N_("pattern"),
576 - N_("ignore refs matching <pattern>")),
576 + N_("ignore refs matching <pattern>")),
577 OPT_GROUP(""),
578 OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")),
579 #ifndef WITH_BREAKING_CHANGES
@@ -585,10 +585,10 @@ int cmd_name_rev(int argc,
585 #endif /* WITH_BREAKING_CHANGES */
586 OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
587 OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
588 - OPT_BOOL(0, "always", &always,
589 - N_("show abbreviated commit object as fallback")),
588 + OPT_BOOL(0, "always", &always,
589 + N_("show abbreviated commit object as fallback")),
590 OPT_HIDDEN_BOOL(0, "peel-tag", &peel_tag,
591 - N_("dereference tags in the input (internal use)")),
591 + N_("dereference tags in the input (internal use)")),
592 OPT_END(),
593 };
594