Re: [PATCH v3 1/3] [Outreachy] t3903-stash: test without configured user name

2018-10-30 Thread Slavica Djukic



On 26-Oct-18 3:13 AM, Junio C Hamano wrote:

Slavica Djukic  writes:


From: Slavica 

Please make sure this matches your sign-off below.


This is part of enhancement request that ask for 'git stash' to work
even if 'user.name' and 'user.email' are not configured.
Due to an implementation detail, git-stash undesirably requires
'user.name' and 'user.email' to be set, but shouldn't.
The issue is discussed here:
https://public-inbox.org/git/87o9debty4@evledraar.gmail.com/T/#u.

As the four lines above summarize the issue being highlighted by the
expect-failure rather well, the last two lines are unnecessary.
Please remove them.  Alternatively, you can place them after the
three-dash lines we see below.


Signed-off-by: Slavica Djukic 
---
  t/t3903-stash.sh | 14 ++
  1 file changed, 14 insertions(+)

diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 9e06494ba0..ae2c905343 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1156,4 +1156,18 @@ test_expect_success 'stash --  works with binary 
files' '
test_path_is_file subdir/untracked
  '
  
+test_expect_failure 'stash works when user.name and user.email are not set' '

+test_commit 1 &&

Just being curious, but do we need a fresh commit created at this
point in the test?  Many tests before this one begin with "git reset"
and then run "git stash" without ever creating commit themselves,
instead relying on the fact that there already is at least one
commit created in the "setup" phase of the test that a "stash"
created can be made relative to.  I do not think this test is all
that special in that regard to require its own commit.


No, we don't need fresh commit here. Thank you for this and all other 
suggestions.


I've changed test according to them.




+test_config user.useconfigonly true &&
+test_config stash.usebuiltin true &&
+sane_unset GIT_AUTHOR_NAME &&
+sane_unset GIT_AUTHOR_EMAIL &&
+sane_unset GIT_COMMITTER_NAME &&
+sane_unset GIT_COMMITTER_EMAIL &&
+test_unconfig user.email &&

There are trailing whitespaces on the line above.  Please remove.

Also, Don't be original in the form alone---all other tests in this
file indent with a leading HT, not four SPs.  Please match the style
of surrounding code.


+test_unconfig user.name &&
+echo changed >1.t &&
+git stash
+'
+
  test_done

Thanks.  Please do not reroll the next round at too rapid a pace.


I've taken my time for next round, I am working on 2/3 and 3/3 parts as 
well.

I wouldn't have sent this patch if I understood you well in previous reply.

Thank you,

Slavica.







Re: [PATCH v3 1/3] [Outreachy] t3903-stash: test without configured user name

2018-10-25 Thread Junio C Hamano
Slavica Djukic  writes:

> From: Slavica 

Please make sure this matches your sign-off below.

> This is part of enhancement request that ask for 'git stash' to work
> even if 'user.name' and 'user.email' are not configured.
> Due to an implementation detail, git-stash undesirably requires
> 'user.name' and 'user.email' to be set, but shouldn't.
> The issue is discussed here:
> https://public-inbox.org/git/87o9debty4@evledraar.gmail.com/T/#u.

As the four lines above summarize the issue being highlighted by the
expect-failure rather well, the last two lines are unnecessary.
Please remove them.  Alternatively, you can place them after the
three-dash lines we see below.

> Signed-off-by: Slavica Djukic 
> ---
>  t/t3903-stash.sh | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
> index 9e06494ba0..ae2c905343 100755
> --- a/t/t3903-stash.sh
> +++ b/t/t3903-stash.sh
> @@ -1156,4 +1156,18 @@ test_expect_success 'stash --  works with 
> binary files' '
>   test_path_is_file subdir/untracked
>  '
>  
> +test_expect_failure 'stash works when user.name and user.email are not set' '
> +test_commit 1 &&

Just being curious, but do we need a fresh commit created at this
point in the test?  Many tests before this one begin with "git reset"
and then run "git stash" without ever creating commit themselves,
instead relying on the fact that there already is at least one
commit created in the "setup" phase of the test that a "stash"
created can be made relative to.  I do not think this test is all
that special in that regard to require its own commit.

> +test_config user.useconfigonly true &&
> +test_config stash.usebuiltin true &&
> +sane_unset GIT_AUTHOR_NAME &&
> +sane_unset GIT_AUTHOR_EMAIL &&
> +sane_unset GIT_COMMITTER_NAME &&
> +sane_unset GIT_COMMITTER_EMAIL &&
> +test_unconfig user.email &&  

There are trailing whitespaces on the line above.  Please remove.

Also, Don't be original in the form alone---all other tests in this
file indent with a leading HT, not four SPs.  Please match the style
of surrounding code.

> +test_unconfig user.name &&
> +echo changed >1.t &&
> +git stash
> +'
> +
>  test_done

Thanks.  Please do not reroll the next round at too rapid a pace.



[PATCH v3 1/3] [Outreachy] t3903-stash: test without configured user name

2018-10-25 Thread Slavica Djukic
From: Slavica 

This is part of enhancement request that ask for 'git stash' to work
even if 'user.name' and 'user.email' are not configured.
Due to an implementation detail, git-stash undesirably requires
'user.name' and 'user.email' to be set, but shouldn't.
The issue is discussed here:
https://public-inbox.org/git/87o9debty4@evledraar.gmail.com/T/#u.

Signed-off-by: Slavica Djukic 
---
 t/t3903-stash.sh | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 9e06494ba0..ae2c905343 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1156,4 +1156,18 @@ test_expect_success 'stash --  works with binary 
files' '
test_path_is_file subdir/untracked
 '
 
+test_expect_failure 'stash works when user.name and user.email are not set' '
+test_commit 1 &&
+test_config user.useconfigonly true &&
+test_config stash.usebuiltin true &&
+sane_unset GIT_AUTHOR_NAME &&
+sane_unset GIT_AUTHOR_EMAIL &&
+sane_unset GIT_COMMITTER_NAME &&
+sane_unset GIT_COMMITTER_EMAIL &&
+test_unconfig user.email &&  
+test_unconfig user.name &&
+echo changed >1.t &&
+git stash
+'
+
 test_done
-- 
2.19.1.windows.1



[PATCH v3 1/3] [Outreachy] t3903-stash: test without configured user name

2018-10-25 Thread Slavica Djukic
Changes since v1:

*changed:
 test_must_fail git config user.email 
 to:
 test_unconfig user.email &&  
 test_unconfig user.name 

This is done to make sure that user.email and user.name are not set,
instead of asserting it with test_must_fail config user.email.



Slavica (1):
  [Outreachy] t3903-stash: test without configured user name

 t/t3903-stash.sh | 14 ++
 1 file changed, 14 insertions(+)

-- 
2.19.1.windows.1