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

Re: [PATCH] t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 16, 2016, 21:51 UTC
Message-ID
<xmqqfumrozzs.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<alpine.DEB.2.20.1611161041040.3746@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 19 quoted lines
> This is the offending part from last night's build:
>
> -- snipsnap --
> 2016-11-16T00:31:57.5321220Z copy.c: In function 'copy_dir_1':
> 2016-11-16T00:31:57.5321220Z copy.c:369:8: error: implicit declaration of function 'lchown' [-Werror=implicit-function-declaration]
> 2016-11-16T00:31:57.5321220Z     if (lchown(dest, source_stat.st_uid, source_stat.st_gid) < 0)
> 2016-11-16T00:31:57.5321220Z         ^~~~~~
> 2016-11-16T00:31:57.5321220Z copy.c:391:7: error: implicit declaration of function 'mknod' [-Werror=implicit-function-declaration]
> 2016-11-16T00:31:57.5321220Z    if (mknod(dest, source_stat.st_mode, source_stat.st_rdev) < 0)
> 2016-11-16T00:31:57.5321220Z        ^~~~~
> 2016-11-16T00:31:57.5321220Z copy.c:405:7: error: implicit declaration of function 'utimes' [-Werror=implicit-function-declaration]
> 2016-11-16T00:31:57.5321220Z    if (utimes(dest, times) < 0)
> 2016-11-16T00:31:57.5321220Z        ^~~~~~
> 2016-11-16T00:31:57.5321220Z copy.c:407:7: error: implicit declaration of function 'chown' [-Werror=implicit-function-declaration]
> 2016-11-16T00:31:57.5321220Z    if (chown(dest, source_stat.st_uid, source_stat.st_gid) < 0) {
> 2016-11-16T00:31:57.5321220Z        ^~~~~
> 2016-11-16T00:31:57.7982432Z     CC ctype.o
> 2016-11-16T00:31:58.1418929Z cc1.exe: all warnings being treated as errors
> 2016-11-16T00:31:58.6368128Z make: *** [Makefile:1988: copy.o] Error 1

That looks like a part of the new 'instead of run_command("cp -R"), let's borrow code from somewhere and do that ourselves' in the nd/worktree-move topic.

The offending part is this:

+ if (S_ISBLK(source_stat.st_mode) || + S_ISCHR(source_stat.st_mode) || + S_ISSOCK(source_stat.st_mode) || + S_ISFIFO(source_stat.st_mode)) { + if (mknod(dest, source_stat.st_mode, source_stat.st_rdev) < 0) + return error_errno(_("can't create '%s'"), dest); + } else + return error(_("unrecognized file '%s' with mode %x"), + source, source_stat.st_mode);

I think all of this is meant to be used to copy what is in the working tree, and what is in the working tree is meant to be tracked by Git, none of the four types that triggers mknod() would be relevant for our purpose. The simplest and cleanest would be to make the above to return error("unsupported filetype").

I do not mind run_command("cp -R") and get rid of this code altogether; that might be a more portable and sensible approach.

Previous: Johannes SchindelinNext: Jeff King
Message 16 of 17 in “mingw: hot-fix t5615”
  1. mingw: hot-fix t5615Johannes Schindelin, Nov 11, 2016
  2. Junio C HamanoNov 11, 2016
  3. Johannes SixtNov 11, 2016
  4. t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variablesJohannes Sixt, Nov 11, 2016
  5. Jeff KingNov 11, 2016
  6. Junio C HamanoNov 11, 2016
  7. Johannes SchindelinNov 12, 2016
  8. Junio C HamanoNov 13, 2016
  9. Lars SchneiderNov 14, 2016
  10. Torsten BögershausenNov 14, 2016
  11. Jeff KingNov 14, 2016
  12. Ramsay JonesNov 14, 2016
  13. Junio C HamanoNov 14, 2016
  14. Johannes SchindelinNov 15, 2016
  15. Johannes SchindelinNov 16, 2016
  16. Junio C HamanoNov 16, 2016
  17. Jeff KingNov 11, 2016

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.