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

[PATCH 1/4] run-command: prettify the `RUN_COMMAND_*` flags

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 9, 2021, 09:47 UTC
Message-ID
<75f39fc80f46455a93f312cce2e989711c748f8a.1631180828.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1035.git.1631180828.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

The values were listed unaligned, and with powers of two spelled out in decimal. The list is easier to parse for human readers if the numbers are aligned and spelled out as powers of two (using the bit-shift operator `<<`).

While at it, remove a code comment that was unclear at best, and confusing at worst.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 run-command.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/run-command.h b/run-command.h
index af1296769f9..3893193f32f 100644
--- a/run-command.h
+++ b/run-command.h
@@ -233,13 +233,13 @@ int run_hook_ve(const char *const *env, const char *name, va_list args);
  */
 int run_auto_maintenance(int quiet);
 
-#define RUN_COMMAND_NO_STDIN 1
-#define RUN_GIT_CMD	     2	/*If this is to be git sub-command */
-#define RUN_COMMAND_STDOUT_TO_STDERR 4
-#define RUN_SILENT_EXEC_FAILURE 8
-#define RUN_USING_SHELL 16
-#define RUN_CLEAN_ON_EXIT 32
-#define RUN_WAIT_AFTER_CLEAN 64
+#define RUN_COMMAND_NO_STDIN		(1<<0)
+#define RUN_GIT_CMD			(1<<1)
+#define RUN_COMMAND_STDOUT_TO_STDERR	(1<<2)
+#define RUN_SILENT_EXEC_FAILURE		(1<<3)
+#define RUN_USING_SHELL			(1<<4)
+#define RUN_CLEAN_ON_EXIT		(1<<5)
+#define RUN_WAIT_AFTER_CLEAN		(1<<6)
 
 /**
  * Convenience functions that encapsulate a sequence of
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 2 of 5 in “Follow-up to js/pull-release-backs-before-fetching”
  1. 0/4 Follow-up to js/pull-release-backs-before-fetchingJohannes Schindelin via GitGitGadget, Sep 9, 2021
  2. 1/4 run-command: prettify the `RUN_COMMAND_*` flagsJohannes Schindelin via GitGitGadget, Sep 9, 2021
  3. 2/4 run-command: offer to close the object store before runningJohannes Schindelin via GitGitGadget, Sep 9, 2021
  4. 3/4 run_auto_maintenance(): implicitly close the object storeJohannes Schindelin via GitGitGadget, Sep 9, 2021
  5. 4/4 Close object store closer to spawning child processesJohannes Schindelin via GitGitGadget, Sep 9, 2021

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.