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

'seen' branch fails to build

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Aug 9, 2025, 13:34 UTC
Message-ID
<92c8c9eb-91de-48c6-88ac-7d5583cc766a@ramsayjones.plus.com>
Hi Junio,

You have probably already fixed this but, just in case you are unaware, the current 'seen' branch @9faf989da6 ("Merge branch 'gh/git-jump-pathname-with-sp' into seen", 2025-08-08) fails to build for me with DEVELOPER=1:

      CC builtin/diff.o
  builtin/diff.c: In function ‘cmd_diff’:
  builtin/diff.c:500:17: error: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
    500 |                 chdir(prefix);
        |                 ^~~~~~~~~~~~~
  cc1: all warnings being treated as errors
  make: *** [Makefile:2818: builtin/diff.o] Error 1

See commit 456a265746 ("diff: --no-index should ignore the worktree", 2025-08-07) in the 'jc/diff-no-index-in-subdir' branch.

In order to get it to build, I just did:
  $ git diff
  diff --git a/builtin/diff.c b/builtin/diff.c
  index 3eb4cbb057..ff16d7be99 100644
  --- a/builtin/diff.c
  +++ b/builtin/diff.c
  @@ -497,7 +497,8 @@ int cmd_diff(int argc,
           * prefix.
           */
          if (no_index && prefix) {
  -               chdir(prefix);
  +               if (chdir(prefix) < 0)
  +                       die_errno(_("cannot chdir to %s"), prefix);
                  prefix = NULL;
          }
   
  $ 
[I don't know if that is the best solution; it was just the quickest! :) ]

ATB, Ramsay Jones

 
Next: Junio C Hamano
Message 1 of 2 in “'seen' branch fails to build”
  1. Ramsay JonesAug 9, 2025
  2. Junio C HamanoAug 10, 2025

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.