git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Lars Schneider <larsxschneider@gmail.com>,
	Johannes Sixt <j6t@kdbg.org>, git <git@vger.kernel.org>,
	Jeff King <peff@peff.net>
Subject: Re: [PATCH] t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables
Date: Wed, 16 Nov 2016 13:51:03 -0800	[thread overview]
Message-ID: <xmqqfumrozzs.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1611161041040.3746@virtualbox> (Johannes Schindelin's message of "Wed, 16 Nov 2016 10:47:08 +0100 (CET)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> 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.


  reply	other threads:[~2016-11-16 21:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 16:29 [PATCH] mingw: hot-fix t5615 Johannes Schindelin
2016-11-11 17:06 ` Junio C Hamano
2016-11-11 17:11   ` Johannes Sixt
2016-11-11 17:31     ` [PATCH] t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables Johannes Sixt
2016-11-11 18:16       ` Jeff King
2016-11-11 18:55       ` Junio C Hamano
2016-11-12 11:40         ` Johannes Schindelin
2016-11-13  1:13           ` Junio C Hamano
2016-11-14  9:11             ` Lars Schneider
2016-11-14 16:35               ` Torsten Bögershausen
2016-11-14 17:01                 ` Jeff King
2016-11-14 19:45                   ` Ramsay Jones
2016-11-14 17:21               ` Junio C Hamano
2016-11-15 16:54                 ` Johannes Schindelin
2016-11-16  9:47                   ` Johannes Schindelin
2016-11-16 21:51                     ` Junio C Hamano [this message]
2016-11-11 18:12 ` [PATCH] mingw: hot-fix t5615 Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqfumrozzs.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=larsxschneider@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).