{"thread":{"id":"55470","subject":"Warning during 'git stash push'","startedAt":"2021-04-10T05:22:24Z","lastAt":"2021-04-10T06:50:59Z","messageCount":2,"participants":["Yuri","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"421517","messageId":"e493ca9b-c686-68ea-cd8d-c7b13766d65e@rawbw.com","threadId":"55470","inReplyTo":null,"subject":"Warning during 'git stash push'","fromName":"Yuri","fromEmail":"yuri@rawbw.com","sentAt":"2021-04-10T04:58:31Z","receivedAt":"2021-04-10T05:22:24Z","isPatch":false,"sender":{"key":"yuri@rawbw.com","avatar":null},"body":"What did you do before the bug happened? (Steps to reproduce your issue)\nTried to stash a particular subdirectory\n\nWhat did you expect to happen? (Expected behavior)\nDirectory should be stashed, obviously,\n\nWhat happened instead? (Actual behavior)\n  git stash push -- x11-toolkits/fltk\nSaved working directory and index state WIP on main: 4c2cc95952a6 \ngraphics/mesa-devel: update to 21.0.b.4390\n<stdin>:83: space before tab in indent.\n      LIBS=\"$LIBS -lX11 $X_EXTRA_LIBS\"\n<stdin>:84: space before tab in indent.\n      CFLAGS=\"$CFLAGS $X_CFLAGS\"\n<stdin>:85: space before tab in indent.\n      CXXFLAGS=\"$CXXFLAGS $X_CFLAGS\"\n<stdin>:88: space before tab in indent.\n      DSOFLAGS=\"$X_LIBS $DSOFLAGS\"\n<stdin>:89: space before tab in indent.\n      $as_echo \"#define USE_X11 1\" >>confdefs.h\nwarning: squelched 40 whitespace errors\nwarning: 45 lines add whitespace errors.\n\n\nWhat's different between what you expected and what actually happened?\nunexpected warnings\n\nAnything else you want to add:\nI did this from w/in of the FreeBSD ports directory, trying to stash \nonly my work in one of subdirectories: x11-toolkits/fltk\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.31.0\ncpu: amd64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: FreeBSD 12.2-STABLE FreeBSD 12.2-STABLE #0 r369528M: Mon Mar 29 \n05:18:24 PDT 2021 \nunknown@nohost.com:/disk-samsung/sys/usr/src/amd64.amd64/sys/GENERIC amd64\ncompiler info: clang: 10.0.1 (git@github.com:llvm/llvm-project.git \nllvmorg-10.0.1-0-gef32c611aa2)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /usr/local/bin/bash\n\n\n[Enabled Hooks]\n\n"},{"id":"421518","messageId":"xmqqim4uk4z4.fsf@gitster.g","threadId":"55470","inReplyTo":"e493ca9b-c686-68ea-cd8d-c7b13766d65e@rawbw.com","subject":"Re: Warning during 'git stash push'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-10T06:50:55Z","receivedAt":"2021-04-10T06:50:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yuri <yuri@rawbw.com> writes:\n\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> Tried to stash a particular subdirectory\n>\n> What did you expect to happen? (Expected behavior)\n> Directory should be stashed, obviously,\n>\n> What happened instead? (Actual behavior)\n>  git stash push -- x11-toolkits/fltk\n> Saved working directory and index state WIP on main: 4c2cc95952a6\n> graphics/mesa-devel: update to 21.0.b.4390\n> <stdin>:83: space before tab in indent.\n>      LIBS=\"$LIBS -lX11 $X_EXTRA_LIBS\"\n> <stdin>:84: space before tab in indent.\n>      CFLAGS=\"$CFLAGS $X_CFLAGS\"\n> <stdin>:85: space before tab in indent.\n>      CXXFLAGS=\"$CXXFLAGS $X_CFLAGS\"\n> <stdin>:88: space before tab in indent.\n>      DSOFLAGS=\"$X_LIBS $DSOFLAGS\"\n> <stdin>:89: space before tab in indent.\n>      $as_echo \"#define USE_X11 1\" >>confdefs.h\n> warning: squelched 40 whitespace errors\n> warning: 45 lines add whitespace errors.\n\n\nThanks for a report.\n\nI wonder if this is one of those regressions introduced during the\nrewrite.\n\nNot even compile tested, but I think the following patch may be a\ngood starting point to help somebody who wants to fix it (it is too\nlate at night for me ;-).\n\n builtin/stash.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git c/builtin/stash.c w/builtin/stash.c\nindex d68ed784d2..c65685de29 100644\n--- c/builtin/stash.c\n+++ w/builtin/stash.c\n@@ -1510,7 +1510,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \n \t\t\tcp_apply.git_cmd = 1;\n \t\t\tstrvec_pushl(&cp_apply.args, \"apply\", \"--index\",\n-\t\t\t\t     \"-R\", NULL);\n+\t\t\t\t     \"-R\", \"--whitespace=nowarn\", NULL);\n \t\t\tif (pipe_command(&cp_apply, out.buf, out.len, NULL, 0,\n \t\t\t\t\t NULL, 0)) {\n \t\t\t\tret = -1;\n@@ -1547,7 +1547,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \n \t\tcp.git_cmd = 1;\n-\t\tstrvec_pushl(&cp.args, \"apply\", \"-R\", NULL);\n+\t\tstrvec_pushl(&cp.args, \"apply\", \"-R\", \"--whitespace=nowarn\", NULL);\n \n \t\tif (pipe_command(&cp, patch.buf, patch.len, NULL, 0, NULL, 0)) {\n \t\t\tif (!quiet)\n"}]}