^D to credentials prompt results in "fatal: ... Success"

2018-06-22 Thread Anthony Sottile
A bit of an amusing edge case. I'm not exactly sure the correct approach to fix this but here's my reproduction, triage, and a few potential options I see. Note that after the username prompt, I pressed ^D $./prefix/bin/git --version git version 2.18.0 $ PATH=$PWD/prefix/bin:$PATH git clone

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-11 Thread Anthony Sottile
On Wed, Jun 6, 2018 at 10:22 AM, Eric Sunshine wrote: > On Wed, Jun 6, 2018 at 1:18 PM, Anthony Sottile wrote: >> On Wed, Jun 6, 2018 at 10:17 AM, Eric Sunshine >> wrote: >>> On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine >>> wrote: >>>> On Mon, J

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Anthony Sottile
On Wed, Jun 6, 2018 at 10:17 AM, Eric Sunshine wrote: > On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine wrote: >> On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: >>> + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf && >> >

[PATCH] config.c: fix regression for core.safecrlf false

2018-06-04 Thread Anthony Sottile
A regression introduced in 8462ff43e42ab67cecd16fdfb59451a53cc8a945 caused autocrlf rewrites to produce a warning message despite setting safecrlf=false. Signed-off-by: Anthony Sottile --- config.c| 2 +- t/t0020-crlf.sh | 10 ++ 2 files changed, 11 insertions(+), 1 deletion

Re: Regression (?) in core.safecrlf=false messaging

2018-06-04 Thread Anthony Sottile
On Mon, Jun 4, 2018 at 12:55 AM, Torsten Bögershausen wrote: > > Does the following patch fix your problem ? > > diff --git a/config.c b/config.c > index 6f8f1d8c11..c625aec96a 100644 > --- a/config.c > +++ b/config.c > @@ -1233,7 +1233,7 @@ static int git_default_core_config(const char *var, >

Regression (?) in core.safecrlf=false messaging

2018-06-03 Thread Anthony Sottile
I'm a bit unclear if I was depending on undocumented behaviour or not here but it seems the messaging has recently changed with respect to `core.safecrlf` My reading of the documentation https://git-scm.com/docs/git-config#git-config-coresafecrlf (I might be wrong here) - core.safecrlf = true ->

[PATCH v2 2/2] diff: finish removal of deprecated -q option

2017-10-13 Thread Anthony Sottile
Functionality was removed in c48f6816f0 but the cli option was not removed. Signed-off-by: Anthony Sottile <asott...@umich.edu> --- builtin/diff-files.c | 2 -- builtin/diff.c | 2 -- diff.h | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/builti

[PATCH v2 1/2] diff: alias -q to --quiet

2017-10-13 Thread Anthony Sottile
::git-log[] That is, it exits with 1 if there were differences and 0 means no differences. +-q:: --quiet:: Disable all output of the program. Implies `--exit-code`. endif::git-log[] 0 $ After: $ ./git diff -q -- Documentation/; echo $? 1 $ Signed-off-by: Anthony Sottile

[PATCH] diff: alias -q to --quiet

2017-10-13 Thread Anthony Sottile
::git-log[] That is, it exits with 1 if there were differences and 0 means no differences. +-q:: --quiet:: Disable all output of the program. Implies `--exit-code`. endif::git-log[] 0 $ After: $ ./git diff -q -- Documentation/; echo $? 1 $ Signed-off-by: Anthony Sottile

[PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-17 Thread Anthony Sottile
The handling of `status_only` no longer interferes with the handling of `unmatch_name_only`. `--quiet` no longer affects the exit code when using `-L`/`--files-without-match`. Signed-off-by: Anthony Sottile <asott...@umich.edu> --- grep.c | 2 +- t/t7810-grep.sh | 5 + 2

Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Anthony Sottile
<gits...@pobox.com> wrote: > Anthony Sottile <asott...@umich.edu> writes: > >> Ah yes, I didn't intend to include the first hunk (forgot to amend it >> out when formatting the patch). >> >> I think git's exit codes for -L actually make more sense than the GN

Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Anthony Sottile
(producing *something* on stdout) and `1` when the search fails. Shall I create a new mail with the adjusted patch as suggested above? (I'm not familiar with the expected workflow). Anthony On Tue, Aug 15, 2017 at 2:33 PM, Junio C Hamano <gits...@pobox.com> wrote: > Anthony Sottile <asott.

[PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Anthony Sottile
The handling of `status_only` no longer interferes with the handling of `unmatch_name_only`. `--quiet` no longer affects the exit code when using `-L`/`--files-without-match`. Signed-off-by: Anthony Sottile <asott...@umich.edu> --- grep.c | 9 + t/t7810-grep.sh | 5 ++

Inconsistent exit code for `git grep --files-without-match` with `--quiet`

2017-08-15 Thread Anthony Sottile
Using the latest revision of git: $ ./git --version git version 2.14.GIT $ ./git-grep --files-without-match nope -- blob.c; echo $? blob.c 0 $ ./git-grep --files-without-match --quiet nope -- blob.c; echo $? 1 I expect both to exit 0 Note that blob.c does not contain "nope", here is the

Re: core.autocrlf=true causes `git apply` to fail on patch generated with `git diff-index HEAD --patch`

2017-08-01 Thread Anthony Sottile
+1,2 @@\n-1\n-2\n+3\n+4\n' + git checkout -- . + git -c core.autocrlf=false apply patch error: patch failed: foo:1 ``` My current workaround is: - try `git apply patch` - try `git -c core.autocrlf=false apply patch` which seems to work pretty well. Anthony On Tue, Aug 1, 2017 at 1:47 PM,

core.autocrlf=true causes `git apply` to fail on patch generated with `git diff-index HEAD --patch`

2017-08-01 Thread Anthony Sottile
Here's my minimal reproduction -- it's slightly far-fetched in that it involves *committing crlf* and then using `autocrlf=true` (commit lf, check out crlf). ``` #!/bin/bash set -ex rm -rf foo git init foo cd foo # Commit crlf into repository git config --local core.autocrlf false python3 -c

Re: [PATCH] Fix minor typo in git-diff docs.

2017-07-31 Thread Anthony Sottile
Thanks! I'll keep this in mind next time I send a patch. Anthony On Mon, Jul 31, 2017 at 9:59 AM, Junio C Hamano <gits...@pobox.com> wrote: > Anthony Sottile <asott...@umich.edu> writes: > >> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt &

git checkout-index --all --force does not restore all files when `core.autocrlf` is set to `input`

2017-07-31 Thread Anthony Sottile
I'm not sure if this is a bug or the intended behaviour. Here's my minimal reproduction (using python3 to write files so I can control line endings) ``` #!/bin/bash set -ex rm -rf repo git init repo cd repo git config --local core.autocrlf input python3 -c 'open("foo",

[PATCH] Fix minor typo in git-diff docs.

2017-07-31 Thread Anthony Sottile
To be honest, I'm a bit overwhelmed by the documentation for submitting a patch! I tried to follow as best I could, here's my attempt (please advise). >From e88ad689a7587c11f270a10f191a3b6bc52a90d4 Mon Sep 17 00:00:00 2001 From: Anthony Sottile <asott...@umich.edu> Date: Mon, 31 Jul 2

Re: bug: `git log --grep ... --invert-grep --author=...` negates / ignores --author

2017-06-01 Thread Anthony Sottile
I actually only expected the --grep to be inverted -- I think I'm on the same page with what's documented. I'd be happy to dig into the code and investigate this some more but I am not familiar with the git codebase, any code hints on where to get bootstrapped? Anthony On Thu, Jun 1, 2017 at

bug: `git log --grep ... --invert-grep --author=...` negates / ignores --author

2017-05-31 Thread Anthony Sottile
commit --allow-empty -m "foo" [master (root-commit) c9df62b] foo asottile@asottile-VirtualBox:/tmp/test$ git commit -m "blah" --allow-empty [master 9e3ee9b] blah asottile@asottile-VirtualBox:/tmp/test$ git log commit 9e3ee9bc1adab2ae8eb1884a8f6237da18dfd27b Author: Anthony Sottile

git submodule add broken (2.11.0-rc1): Cannot open git-sh-i18n

2016-11-07 Thread Anthony Sottile
Noticed as part of my automated tests here: https://travis-ci.org/pre-commit/pre-commit/jobs/173957051 Minimal reproduction: rm -rf /tmp/git /tmp/foo /tmp/bar git clone git://github.com/git/git --depth 1 /tmp/git pushd /tmp/git make -j 8 popd export PATH="/tmp/git:$PATH" git init /tmp/foo git

Fwd: Git clone fails during pre-commit hook due to GIT_WORK_TREE=. (regression 2.5 -> 2.6)

2015-11-23 Thread Anthony Sottile
* Short description of the problem * It seems GIT_WORK_DIR is now exported invariantly when calling git hooks such as pre-commit. If these hooks involve cloning repositories they will not fail due to this exported environment variable. This was not the case in prior versions (such as v2.5.0).