git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Yuri <yuri@rawbw.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Warning during 'git stash push'
Date: Fri, 09 Apr 2021 23:50:55 -0700	[thread overview]
Message-ID: <xmqqim4uk4z4.fsf@gitster.g> (raw)
In-Reply-To: <e493ca9b-c686-68ea-cd8d-c7b13766d65e@rawbw.com> (yuri@rawbw.com's message of "Fri, 9 Apr 2021 21:58:31 -0700")

Yuri <yuri@rawbw.com> writes:

> What did you do before the bug happened? (Steps to reproduce your issue)
> Tried to stash a particular subdirectory
>
> What did you expect to happen? (Expected behavior)
> Directory should be stashed, obviously,
>
> What happened instead? (Actual behavior)
>  git stash push -- x11-toolkits/fltk
> Saved working directory and index state WIP on main: 4c2cc95952a6
> graphics/mesa-devel: update to 21.0.b.4390
> <stdin>:83: space before tab in indent.
>      LIBS="$LIBS -lX11 $X_EXTRA_LIBS"
> <stdin>:84: space before tab in indent.
>      CFLAGS="$CFLAGS $X_CFLAGS"
> <stdin>:85: space before tab in indent.
>      CXXFLAGS="$CXXFLAGS $X_CFLAGS"
> <stdin>:88: space before tab in indent.
>      DSOFLAGS="$X_LIBS $DSOFLAGS"
> <stdin>:89: space before tab in indent.
>      $as_echo "#define USE_X11 1" >>confdefs.h
> warning: squelched 40 whitespace errors
> warning: 45 lines add whitespace errors.


Thanks for a report.

I wonder if this is one of those regressions introduced during the
rewrite.

Not even compile tested, but I think the following patch may be a
good starting point to help somebody who wants to fix it (it is too
late at night for me ;-).

 builtin/stash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git c/builtin/stash.c w/builtin/stash.c
index d68ed784d2..c65685de29 100644
--- c/builtin/stash.c
+++ w/builtin/stash.c
@@ -1510,7 +1510,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
 
 			cp_apply.git_cmd = 1;
 			strvec_pushl(&cp_apply.args, "apply", "--index",
-				     "-R", NULL);
+				     "-R", "--whitespace=nowarn", NULL);
 			if (pipe_command(&cp_apply, out.buf, out.len, NULL, 0,
 					 NULL, 0)) {
 				ret = -1;
@@ -1547,7 +1547,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
 		struct child_process cp = CHILD_PROCESS_INIT;
 
 		cp.git_cmd = 1;
-		strvec_pushl(&cp.args, "apply", "-R", NULL);
+		strvec_pushl(&cp.args, "apply", "-R", "--whitespace=nowarn", NULL);
 
 		if (pipe_command(&cp, patch.buf, patch.len, NULL, 0, NULL, 0)) {
 			if (!quiet)

      reply	other threads:[~2021-04-10  6:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  4:58 Warning during 'git stash push' Yuri
2021-04-10  6:50 ` Junio C Hamano [this message]

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

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

  git send-email \
    --in-reply-to=xmqqim4uk4z4.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=yuri@rawbw.com \
    /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.
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 NNTP newsgroup(s).