git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:15 UTC

[PATCH v5 2/5] name-rev: run clang-format before factoring code

From
Kkristofferhaugsbakk@fastmail.com <kristofferhaugsbakk@fastmail.com>
Date
May 11, 2026, 15:45 UTC
Message-ID
<V5_name-rev_clang-format.6cb@msgid.xyz>
In-Reply-To
<V5_CV_format-rev.6c9@msgid.xyz>
From: Kristoffer Haugsbakk <code@khaugsbakk.name>

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>
---
 builtin/name-rev.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 171e7bd0e98..6357eaa76d0 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -519,22 +519,22 @@ static void name_rev_line(char *p, struct name_ref_data *data)
 		if (!ishex(*p)) {
 			counter = 0;
 		} else if (++counter == hexsz &&
-			 !ishex(*(p+1))) {
+			   !ishex(*(p + 1))) {
 			struct object_id oid;
 			const char *name = NULL;
-			char c = *(p+1);
+			char c = *(p + 1);
 			int p_len = p - p_start + 1;
 
 			counter = 0;
 
-			*(p+1) = 0;
+			*(p + 1) = 0;
 			if (!repo_get_oid(the_repository, p - (hexsz - 1), &oid)) {
 				struct object *o =
 					lookup_object(the_repository, &oid);
 				if (o)
 					name = get_rev_name(o, &buf);
 			}
-			*(p+1) = c;
+			*(p + 1) = c;
 
 			if (!name)
 				continue;
@@ -571,9 +571,9 @@ int cmd_name_rev(int argc,
 		OPT_BOOL(0, "name-only", &data.name_only, N_("print only ref-based names (no object names)")),
 		OPT_BOOL(0, "tags", &data.tags_only, N_("only use tags to name the commits")),
 		OPT_STRING_LIST(0, "refs", &data.ref_filters, N_("pattern"),
-				   N_("only use refs matching <pattern>")),
+				N_("only use refs matching <pattern>")),
 		OPT_STRING_LIST(0, "exclude", &data.exclude_filters, N_("pattern"),
-				   N_("ignore refs matching <pattern>")),
+				N_("ignore refs matching <pattern>")),
 		OPT_GROUP(""),
 		OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")),
 #ifndef WITH_BREAKING_CHANGES
@@ -585,10 +585,10 @@ int cmd_name_rev(int argc,
 #endif /* WITH_BREAKING_CHANGES */
 		OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
 		OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
-		OPT_BOOL(0, "always",     &always,
-			   N_("show abbreviated commit object as fallback")),
+		OPT_BOOL(0, "always", &always,
+			 N_("show abbreviated commit object as fallback")),
 		OPT_HIDDEN_BOOL(0, "peel-tag", &peel_tag,
-			   N_("dereference tags in the input (internal use)")),
+				N_("dereference tags in the input (internal use)")),
 		OPT_END(),
 	};
 
-- 
2.54.0.13.g9c7419e39f8
Previous: kristofferhaugsbakk@fastmail.comNext: kristofferhaugsbakk@fastmail.com
Message 42 of 45 in “name-rev: learn --format=<pretty>”
  1. 0/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 13, 2026
  2. 1/2 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, Mar 13, 2026
  3. 2/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 13, 2026
  4. Junio C HamanoMar 14, 2026
  5. Junio C HamanoMar 14, 2026
  6. Kristoffer HaugsbakkMar 17, 2026
  7. Kristoffer HaugsbakkMar 17, 2026
  8. Kristoffer HaugsbakkMar 18, 2026
  9. 0/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 20, 2026
  10. 1/2 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, Mar 20, 2026
  11. 2/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 20, 2026
  12. D. Ben KnobleMar 20, 2026
  13. Kristoffer HaugsbakkMar 23, 2026
  14. 0/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  15. 1/5 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, Apr 28, 2026
  16. 2/5 name-rev: run clang-format before factoring codekristofferhaugsbakk@fastmail.com, Apr 28, 2026
  17. 3/5 name-rev: factor code for sharing with a new commandkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  18. 4/5 name-rev: make dedicated --annotate-stdin --name-only testkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  19. 5/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  20. Kristoffer HaugsbakkApr 29, 2026
  21. Kristoffer HaugsbakkApr 30, 2026
  22. Kristoffer HaugsbakkApr 30, 2026
  23. Phillip WoodApr 30, 2026
  24. Phillip WoodMay 1, 2026
  25. kristofferhaugsbakk@fastmail.comMay 1, 2026
  26. kristofferhaugsbakk@fastmail.comMay 1, 2026
  27. Phillip WoodMay 2, 2026
  28. Phillip WoodMay 2, 2026
  29. Junio C HamanoMay 3, 2026
  30. Kristoffer HaugsbakkMay 5, 2026
  31. Kristoffer HaugsbakkMay 5, 2026
  32. 0/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 7, 2026
  33. 1/5 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, May 7, 2026
  34. 2/5 name-rev: run clang-format before factoring codekristofferhaugsbakk@fastmail.com, May 7, 2026
  35. 3/5 name-rev: factor code for sharing with a new commandkristofferhaugsbakk@fastmail.com, May 7, 2026
  36. 4/5 name-rev: make dedicated --annotate-stdin --name-only testkristofferhaugsbakk@fastmail.com, May 7, 2026
  37. 5/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 7, 2026
  38. Kristoffer HaugsbakkMay 8, 2026
  39. Kristoffer HaugsbakkMay 11, 2026
  40. 0/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 11, 2026
  41. 1/5 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, May 11, 2026
  42. 2/5 name-rev: run clang-format before factoring codekristofferhaugsbakk@fastmail.com, May 11, 2026
  43. 3/5 name-rev: factor code for sharing with a new commandkristofferhaugsbakk@fastmail.com, May 11, 2026
  44. 4/5 name-rev: make dedicated --annotate-stdin --name-only testkristofferhaugsbakk@fastmail.com, May 11, 2026
  45. 5/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 11, 2026

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.