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

Re: [PATCH] sequencer: cleanup for gcc 8.2.1 warning

From
Carlo Arenas <carenas@gmail.com>
Date
Oct 25, 2018, 07:10 UTC
Message-ID
<CAPUEsphHsWVzdGXBB0EOSNuUb5gNgjyJ+i7PnDJx7LBqejQrNQ@mail.gmail.com>
In-Reply-To
<xmqq8t2mk0jo.fsf@gitster-ct.c.googlers.com>
On Wed, Oct 24, 2018 at 11:22 PM Junio C Hamano <gitster@pobox.com> wrote:
> and they would read naturally.  But may be it is a bit too cute an
> idea?  I dunno.

my first idea was to replace it with a helper called touch_file, since I was expecting it will be a popular operation as flag files are common in shell scripts and that name will be second nature to anyone porting them.

the fact that the quiet flag was created with a single '\n' in the code just immediately above this make me go for the proposed "solution" instead (which I verified wouldn't change behaviour as you described in your post; I apologize for not documenting it in the commit and wasting your time).

would something like this work better? (not to apply, and probably mangled)
--- a/sequencer.c
+++ b/sequencer.c
@@ -35,6 +35,8 @@

 #define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"

+#define touch_file(path) write_file(path, "%s", "")
+
 const char sign_off_header[] = "Signed-off-by: ";
 static const char cherry_picked_prefix[] = "(cherry picked from commit ";

@@ -2389,7 +2391,7 @@ int write_basic_state(struct replay_opts *opts,
const char *head_name,
                write_file(rebase_path_quiet(), "\n");

        if (opts->verbose)
-               write_file(rebase_path_verbose(), "");
+               touch_file(rebase_path_verbose());
        if (opts->strategy)
                write_file(rebase_path_strategy(), "%s\n", opts->strategy);
        if (opts->xopts_nr > 0)
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “sequencer: cleanup for gcc 8.2.1 warning”
  1. sequencer: cleanup for gcc 8.2.1 warningCarlo Marcelo Arenas Belón, Oct 25, 2018
  2. Junio C HamanoOct 25, 2018
  3. Junio C HamanoOct 25, 2018
  4. Carlo ArenasOct 25, 2018
  5. Junio C HamanoOct 25, 2018
  6. Carlo ArenasOct 25, 2018
  7. sequencer: cleanup for gcc warning in non developer modeCarlo Marcelo Arenas Belón, Oct 25, 2018

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.