Re: [PATCH 2/5] t4108: remove git command upstream of pipe

2019-10-23 Thread Denton Liu
On Wed, Oct 23, 2019 at 09:32:26AM -0400, Eric Sunshine wrote: > On Wed, Oct 23, 2019 at 8:04 AM Denton Liu wrote: > > Before, the output of `git diff HEAD` would always be piped to > > sanitize_conflicted_diff(). However, since the Git command was upstream > > of the

[PATCH 1/5] t4108: replace create_file with test_write_lines

2019-10-23 Thread Denton Liu
ce to put it. Signed-off-by: Denton Liu --- t/t4108-apply-threeway.sh | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh index fa5d4efb89..b109ecbd9f 100755 --- a/t/t4108-apply-threeway.sh +++ b/t/

[PATCH 3/5] t4108: use `test_config` instead of `git config`

2019-10-23 Thread Denton Liu
Since `git config` leaves the configurations set even after the test case completes, use `test_config` instead so that the configurations are reset once the test case finishes. Signed-off-by: Denton Liu --- t/t4108-apply-threeway.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 2/5] t4108: remove git command upstream of pipe

2019-10-23 Thread Denton Liu
the command `git diff HEAD` was being piped to sanitize_conflicted_diff(), move the command into the function and rename it to print_sanitized_diff(). Signed-off-by: Denton Liu --- t/t4108-apply-threeway.sh | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/t/t4108

[PATCH 0/5] apply: fix merge.conflictStyle bug in --3way

2019-10-23 Thread Denton Liu
This fixes a bug where even if `merge.conflictStyle = diff3`, running `git apply --3way` would not output the base. Patches 1-3 are general cleanup for t4108, 4 demonstrates the bug and 5 actually fixes it. Denton Liu (5): t4108: replace create_file with test_write_lines t4108: remove git

[PATCH 4/5] t4108: demonstrate bug in apply

2019-10-23 Thread Denton Liu
o sanitize `|||` conflict markers. Signed-off-by: Denton Liu --- t/t4108-apply-threeway.sh | 58 --- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh index 3615256492..84347fc178 100755 --- a/t/t

[PATCH 5/5] apply: respect merge.conflictStyle in --3way

2019-10-23 Thread Denton Liu
Before, when doing a 3-way merge, the merge.conflictStyle option was not respected and the "merge" style was always used, even if "diff3" was specified. Call git_xmerge_config() at the end of git_apply_config() so that the merge.conflictStyle config is read. Signe

Re: [BUG] "--show-current-patch" return a mail instead of a patch

2019-10-23 Thread Denton Liu
On Wed, Oct 23, 2019 at 10:15:15AM +, Jerome Pouiller wrote: > On Wednesday 23 October 2019 10:55:03 CEST Denton Liu wrote: > > I am currently have a WIP patchset that will print the location of the > > failed patch file (.git/rebase-apply/patch) in the case of a failure as

Re: [BUG] "--show-current-patch" return a mail instead of a patch

2019-10-23 Thread Denton Liu
Hi Jerome, On Wed, Oct 23, 2019 at 08:49:41AM +, Jerome Pouiller wrote: > On Wednesday 23 October 2019 04:24:58 CEST Junio C Hamano wrote: > > Jerome Pouiller writes: > > > I try to use "git am" to apply a patch sent using "git send-email". This > > > patch does not apply properly. I try to u

[PATCH v3 12/14] t5520: replace subshell cat comparison with test_cmp

2019-10-22 Thread Denton Liu
l clean up situations where we have multiple duplicate statements within a test case. This is done to keep this patch purely mechanical. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 105 1 file changed, 70 insertions(+), 35 deletions(-) diff --gi

[PATCH v3 13/14] t5520: remove redundant lines in test cases

2019-10-22 Thread Denton Liu
of the file stays the same throughout the whole test case. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 8 1 file changed, 8 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index c9e4eec004..ef3dbc201a 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -147,7 +147,6

[PATCH v3 09/14] t5520: use test_cmp_rev where possible

2019-10-22 Thread Denton Liu
quot;$(git rev-parse.* \([^)]*\))"/test_cmp_rev ! \1 \2/ Signed-off-by: Denton Liu --- t/t5520-pull.sh | 50 - 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 18225d8430..1af6ea06ee 100755

[PATCH v3 10/14] t5520: test single-line files by git with test_cmp

2019-10-22 Thread Denton Liu
le duplicate statements within a test case. This is done to keep this patch purely mechanical. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 64 - 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh i

[PATCH v3 08/14] t5520: replace test -{n,z} with test-lib functions

2019-10-22 Thread Denton Liu
st -n` or `test -z`, replace them respectively with invocations of test_file_not_empty() and test_must_be_empty() so that we get better debugging information in the case of a failure. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 12 1 file changed, 8 insertions(+), 4 deletions(-)

[PATCH v3 14/14] t5520: replace `! git` with `test_must_fail git`

2019-10-22 Thread Denton Liu
Currently, if a Git command fails in an unexpected way, such as a segfault, it will be masked and ignored. Replace the ! with test_must_fail so that only expected failures pass. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH v3 06/14] t5520: remove spaces after redirect operator

2019-10-22 Thread Denton Liu
The style for tests in Git is to have the redirect operator attached to the filename with no spaces. Fix test cases where this is not the case. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520

[PATCH v3 07/14] t5520: use test_line_count where possible

2019-10-22 Thread Denton Liu
Instead of rolling our own functionality to test the number of lines a command outputs, use test_line_count() which provides better debugging information in the case of a failure. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH v3 11/14] t5520: don't put git in upstream of pipe

2019-10-22 Thread Denton Liu
Before, if the invocation of git failed, it would be masked by the pipe since only the return code of the last element of a pipe is used. Rewrite the test to put the Git command on its own line so its return code is not masked. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 3 ++- 1 file

[PATCH v3 05/14] t5520: replace test -f with test-lib functions

2019-10-22 Thread Denton Liu
case of `! test -f`, not only should that path not be a file, it shouldn't exist at all so replace it with test_path_is_missing(). Signed-off-by: Denton Liu --- t/t5520-pull.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh

[PATCH v3 03/14] t5520: use sq for test case names

2019-10-22 Thread Denton Liu
The usual convention is for test case names to be written between single-quotes. Change all double-quoted test case names to single-quotes except for two test case names that use variables within. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v3 04/14] t5520: let sed open its own input

2019-10-22 Thread Denton Liu
We were using a redirection operator to feed input into sed. However, since sed is capable of opening its own files, make sed open its own files instead of redirecting input into it. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 00/14] t5520: various test cleanup

2019-10-22 Thread Denton Liu
Rebase against the latest master since this topic hasn't been picked up yet Changes since v1: * Incorporate Eric's feedback Denton Liu (14): t: teach test_cmp_rev to accept ! for not-equals t5520: improve test style t5520: use sq for test case names t5520: let sed open its own input

[PATCH v3 01/14] t: teach test_cmp_rev to accept ! for not-equals

2019-10-22 Thread Denton Liu
e `git rev-parse` segfaults and dies unexpectedly, the failure will be ignored. Rewrite test_cmp_rev() to optionally accept "!" as the first argument to do a not-equals comparison. Rewrite `! test_cmp_rev` to `test_cmp_rev !` in all tests to take advantage of this new functionality. Signed-of

[PATCH v3 02/14] t5520: improve test style

2019-10-22 Thread Denton Liu
Improve the test style by removing leading and trailing empty lines within test cases. Also, reformat multi-line subshells to conform to the existing style. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 88 + 1 file changed, 45 insertions(+), 43

[PATCH] t7419: change test_must_fail to ! for grep

2019-10-22 Thread Denton Liu
According to t/README, test_must_fail() should only be used to test for failure in Git commands. Replace the invocations of `test_must_fail grep` with `! grep`. Signed-off-by: Denton Liu --- *sigh* Here's another cleanup patch for 'dl/submodule-set-branch'. It's inspire

Re: [RFC PATCH 1/7] Makefile: alphabetically sort += lists

2019-10-21 Thread Denton Liu
Hi Johannes, On Mon, Oct 21, 2019 at 08:44:40PM +0200, Johannes Schindelin wrote: > Hi Junio, > > On Fri, 18 Oct 2019, Junio C Hamano wrote: > > > Denton Liu writes: > > > > > There are many += lists in the Makefile and, over time, they have gotten > >

[PATCH] rebase: hide --preserve-merges option

2019-10-18 Thread Denton Liu
Since --preserve-merges has been deprecated in favour of --rebase-merges, mark this option as hidden so it no longer shows up in the usage and completions. Signed-off-by: Denton Liu --- This patch continues the deprecation effort and can be based on top of `js/rebase-deprecate-preserve-merges

Re: [PATCH v2 00/15] t5520: various test cleanup

2019-10-18 Thread Denton Liu
Sorry for the double-send. public-inbox and MARC both showed that only 3 messages got through the in the first send so I sent it again. Seems to have gotten through find the second time around. On Fri, Oct 18, 2019 at 03:04:03PM -0700, Denton Liu wrote: > Like earlier patchsets, I want

[PATCH v2 00/15] t5520: various test cleanup

2019-10-18 Thread Denton Liu
anup to an unrelated test that I found while addressing some of Eric's comments. 2/15 is a general improvement to test_rev_cmp() that will be used later in the series. Changes since v1: * Incorporate Eric's feedback Denton Liu (15): t7408: replace `test_must_fail test_path_is_file` t

[PATCH v2 03/15] t5520: improve test style

2019-10-18 Thread Denton Liu
Improve the test style by removing leading and trailing empty lines within test cases. Also, reformat multi-line subshells to conform to the existing style. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 88 + 1 file changed, 45 insertions(+), 43

[PATCH v2 10/15] t5520: use test_cmp_rev where possible

2019-10-18 Thread Denton Liu
quot;$(git rev-parse.* \([^)]*\))"/test_cmp_rev ! \1 \2/ Signed-off-by: Denton Liu --- t/t5520-pull.sh | 50 - 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 18225d8430..1af6ea06ee 100755

[PATCH v2 11/15] t5520: test single-line files by git with test_cmp

2019-10-18 Thread Denton Liu
le duplicate statements within a test case. This is done to keep this patch purely mechanical. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 64 - 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh i

[PATCH v2 15/15] t5520: replace `! git` with `test_must_fail git`

2019-10-18 Thread Denton Liu
Currently, if a Git command fails in an unexpected way, such as a segfault, it will be masked and ignored. Replace the ! with test_must_fail so that only expected failures pass. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH v2 07/15] t5520: remove spaces after redirect operator

2019-10-18 Thread Denton Liu
The style for tests in Git is to have the redirect operator attached to the filename with no spaces. Fix test cases where this is not the case. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520

[PATCH v2 12/15] t5520: don't put git in upstream of pipe

2019-10-18 Thread Denton Liu
Before, if the invocation of git failed, it would be masked by the pipe since only the return code of the last element of a pipe is used. Rewrite the test to put the Git command on its own line so its return code is not masked. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 3 ++- 1 file

[PATCH v2 13/15] t5520: replace subshell cat comparison with test_cmp

2019-10-18 Thread Denton Liu
l clean up situations where we have multiple duplicate statements within a test case. This is done to keep this patch purely mechanical. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 105 1 file changed, 70 insertions(+), 35 deletions(-) diff --gi

[PATCH v2 05/15] t5520: let sed open its own input

2019-10-18 Thread Denton Liu
We were using a redirection operator to feed input into sed. However, since sed is capable of opening its own files, make sed open its own files instead of redirecting input into it. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 08/15] t5520: use test_line_count where possible

2019-10-18 Thread Denton Liu
Instead of rolling our own functionality to test the number of lines a command outputs, use test_line_count() which provides better debugging information in the case of a failure. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH v2 06/15] t5520: replace test -f with test-lib functions

2019-10-18 Thread Denton Liu
case of `! test -f`, not only should that path not be a file, it shouldn't exist at all so replace it with test_path_is_missing(). Signed-off-by: Denton Liu --- t/t5520-pull.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh

[PATCH v2 04/15] t5520: use sq for test case names

2019-10-18 Thread Denton Liu
The usual convention is for test case names to be written between single-quotes. Change all double-quoted test case names to single-quotes except for two test case names that use variables within. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v2 02/15] t: teach test_cmp_rev to accept ! for not-equals

2019-10-18 Thread Denton Liu
e `git rev-parse` segfaults and dies unexpectedly, the failure will be ignored. Rewrite test_cmp_rev() to optionally accept "!" as the first argument to do a not-equals comparison. Rewrite `! test_cmp_rev` to `test_cmp_rev !` in all tests to take advantage of this new functionality. Signed-of

[PATCH v2 01/15] t7408: replace `test_must_fail test_path_is_file`

2019-10-18 Thread Denton Liu
According to t/README, test_must_fail() should only be used to test for failure in git commands. Replace the only invocation of `test_must_fail test_path_is_file` with `test_path_is_missing` since in this test case, the path should not exist at all. Signed-off-by: Denton Liu --- t/t7408

[PATCH v2 14/15] t5520: remove redundant lines in test cases

2019-10-18 Thread Denton Liu
of the file stays the same throughout the whole test case. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 8 1 file changed, 8 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index c9e4eec004..ef3dbc201a 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -147,7 +147,6

[PATCH v2 09/15] t5520: replace test -{n,z} with test-lib functions

2019-10-18 Thread Denton Liu
st -n` or `test -z`, replace them respectively with invocations of test_file_not_empty() and test_must_be_empty() so that we get better debugging information in the case of a failure. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 12 1 file changed, 8 insertions(+), 4 deletions(-)

Re: [PATCH 08/12] t5520: use test_cmp_rev where possible

2019-10-18 Thread Denton Liu
7, 2019 at 07:41:44PM -0400, Eric Sunshine wrote: > On Thu, Oct 17, 2019 at 7:17 PM Denton Liu wrote: > > In case an invocation of `git rev-list` fails within the subshell, the > > failure will be masked. Remove the subshell and use test_cmp_rev() so > > that failures can be di

[PATCH 4.5/12] t5520: replace test -f with test-lib functions

2019-10-17 Thread Denton Liu
case of `! test -f`, replace it with test_path_is_missing(). Signed-off-by: Denton Liu --- I just realised that test_path_is_missing() is a much better replacement than `test_must_fail test_path_is_file`. Please use this patch instead of 04/12. t/t5520-pull.sh | 10 +- 1 file changed, 5

[PATCH 00/12] t5520: various test cleanup

2019-10-17 Thread Denton Liu
Like earlier patchsets, I want to implement a feature that involves modifications to the test suite. Since that feature will probably take a while to polish up, however, let's clean up the test suite in a separate patchset first so it's not blocked by the feature work. Denton Liu (12

[PATCH 01/12] t5520: improve test style

2019-10-17 Thread Denton Liu
Improve the test style by removing leading and trailing empty lines within test cases. Also, reformat multi-line subshells to conform to the existing style. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 88 + 1 file changed, 45 insertions(+), 43

[PATCH 05/12] t5520: remove spaces after redirect operator

2019-10-17 Thread Denton Liu
The style for tests in Git is to have the redirect operator attached to the filename with no spaces. Fix test cases where this is not the case. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520

[PATCH 03/12] t5520: let sed open its own input

2019-10-17 Thread Denton Liu
We were using a redirection operator to feed input into sed. However, since sed is capable of opening its own files, make sed open its own files instead of redirecting input into it. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 04/12] t5520: replace test -f with test_path_is_file

2019-10-17 Thread Denton Liu
: Denton Liu --- t/t5520-pull.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 55560ce3cd..5ab5ec508a 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -39,8 +39,8 @@ test_expect_success 'pulling into

[PATCH 11/12] t5520: replace subshell cat comparison with test_cmp

2019-10-17 Thread Denton Liu
expressions: s/\(\s*\)test \([^=]*\)= "$(cat \([^)]*\))"/\1echo \2>expect \&\&\n\1test_cmp expect \3/ s/\(\s*\)test "$(cat \([^)]*\))" = \([^&]*\)\( &&\)\?$/\1echo \3 >expect \&\&\n\1test_cmp expect \2\4/

[PATCH 10/12] t5520: don't put git in upstream of pipe

2019-10-17 Thread Denton Liu
Before, if the invocation of git failed, it would be masked by the pipe since only the return code of the last element of a pipe is used. Rewrite the test to put the Git command on its own line so its return code is not masked. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 3 ++- 1 file

[PATCH 02/12] t5520: use sq for test case names

2019-10-17 Thread Denton Liu
The usual convention is for test case names to be written between single-quotes. Change all double-quoted test case names to single-quotes except for two test case names that use variables within. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 12/12] t5520: replace `! git` with `test_must_fail git`

2019-10-17 Thread Denton Liu
Currently, if a Git command fails in an unexpected way, such as a segfault, it will be masked and ignored. Replace the ! with test_must_fail so that only expected failures pass. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH 08/12] t5520: use test_cmp_rev where possible

2019-10-17 Thread Denton Liu
) != "$(git rev-parse.* \([^)]*\))"/test_must_fail test_cmp_rev \1 \2/ Signed-off-by: Denton Liu --- t/t5520-pull.sh | 50 - 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index c7797

[PATCH 09/12] t5520: test single-line files by git with test_cmp

2019-10-17 Thread Denton Liu
\2 >expect \&\&\n\1\3 >actual \&\&\n\1test_cmp expect actual/ s/\(\s*\)test "$(\(git [^)]*\))" = \([^ ]*\)/\1echo \3 >expect \&\&\n\1\2 >actual \&\&\n\1test_cmp expect actual/ Signed-off-by: Denton Liu --- t/t5520-pull.sh | 64 +

[PATCH 07/12] t5520: replace test -{n,z} with test-lib functions

2019-10-17 Thread Denton Liu
Instead of using `test -n` or `test -z`, replace them respectively with invocations of test_file_not_empty() and test_must_be_empty(). Signed-off-by: Denton Liu --- t/t5520-pull.sh | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh

[PATCH 06/12] t5520: use test_line_count where possible

2019-10-17 Thread Denton Liu
Instead of rolling our own functionality to test the number of lines a command outputs, use test_line_count() which provides better debugging information in the case of a failure. Signed-off-by: Denton Liu --- t/t5520-pull.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[RFC PATCH 6/7] autostash.c: undefine USE_THE_INDEX_COMPATIBILITY_MACROS

2019-10-16 Thread Denton Liu
Since autostash.c was recently introduced, we should avoid USE_THE_INDEX_COMPATIBILITY_MACROS since we are trying to move away from this in the rest of the codebase. Rewrite the autostash code to not need it and remove its definition. Signed-off-by: Denton Liu --- autostash.c | 8 +++- 1

[RFC PATCH 1/7] Makefile: alphabetically sort += lists

2019-10-16 Thread Denton Liu
There are many += lists in the Makefile and, over time, they have gotten slightly out of order, alphabetically. Alphabetically sort all += lists to bring them back in order. Signed-off-by: Denton Liu --- Makefile | 75 1 file changed, 38

[RFC PATCH 5/7] autostash: extract perform_autostash() from rebase

2019-10-16 Thread Denton Liu
Continue the process of lib-ifying the autostash code. In a future commit, this will be used to implement `--autostash` in other builtins. This patch is best viewed with `--color-moved` and `--color-moved-ws=allow-indentation-change`. Signed-off-by: Denton Liu --- autostash.c | 46

[RFC PATCH 0/7] merge: learn --autostash

2019-10-16 Thread Denton Liu
right. Since this is an RFC, we're missing tests and documentation but I've tested it and it seems to work reasonably well. [1]: https://github.com/gitgitgadget/git/issues/394 Denton Liu (7): Makefile: alphabetically sort += lists autostash: extract read_one() from rebase aut

[RFC PATCH 3/7] autostash: extract apply_autostash() from rebase

2019-10-16 Thread Denton Liu
Continue the process of lib-ifying the autostash code. In a future commit, this will be used to implement `--autostash` in other builtins. This patch is best viewed with `--color-moved` and `--color-moved-ws=allow-indentation-change`. Signed-off-by: Denton Liu --- autostash.c | 46

[RFC PATCH 7/7] merge: teach --autostash option

2019-10-16 Thread Denton Liu
then pops after. Reported-by: Alban Gruin Signed-off-by: Denton Liu --- builtin/merge.c | 13 + builtin/pull.c | 9 + t/t5520-pull.sh | 8 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/builtin/merge.c b/builtin/merge.c index 062e911441

[RFC PATCH 4/7] autostash: extract reset_head() from rebase

2019-10-16 Thread Denton Liu
Begin the process of lib-ifying the autostash code. In a future commit, This patch is best viewed with `--color-moved` and `--color-moved-ws=allow-indentation-change`. this will be used to implement `--autostash` in other builtins. Signed-off-by: Denton Liu --- autostash.c | 137

[RFC PATCH 2/7] autostash: extract read_one() from rebase

2019-10-16 Thread Denton Liu
Begin the process of lib-ifying the autostash code. In a future commit, this will be used to implement `--autostash` in other builtins. This patch is best viewed with `--color-moved` and `--color-moved-ws=allow-indentation-change`. Signed-off-by: Denton Liu --- autostash.c | 12

[PATCH v6 3/3] format-patch: teach --cover-from-description option

2019-10-15 Thread Denton Liu
ormat-patch to accept the `--cover-from-description` option and corresponding `format.coverFromDescription` config, allowing users to populate different parts of the cover letter (including the subject now). Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- Documentation/config/forma

[PATCH v6 0/3] format-patch: learn --infer-cover-subject option (also t4014 cleanup)

2019-10-15 Thread Denton Liu
ferCoverSubject was borrowed from this config but it also did not state what the default value was) * In 1/4, rename all instances of "expected" to "expect" [1]: https://public-inbox.org/git/cover.1558492582.git.liu.den...@gmail.com/ Denton Liu (3): format-patch: replac

[PATCH v6 2/3] format-patch: use enum variables

2019-10-15 Thread Denton Liu
Before, `thread` and `config_cover_letter` were defined as ints even though they behaved as enums. Define actual enums and change these variables to use these new definitions. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- builtin/log.c | 30 +- 1 file

[PATCH v6 1/3] format-patch: replace erroneous and condition

2019-10-15 Thread Denton Liu
SHALLOW` is a no-op. Replace this errorneous and condition with a ternary statement so that it is clear what the configured value is when a boolean is given. Signed-off-by: Denton Liu --- builtin/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/log.c b/bui

Re: [PATCH v5 1/3] format-patch: change erroneous and condition

2019-10-14 Thread Denton Liu
Hi Junio, Thanks for the feedback. On Tue, Oct 15, 2019 at 11:16:35AM +0900, Junio C Hamano wrote: > Denton Liu writes: > > > Since this > > seems to be a Python-ism that's mistakenly leaked into our code, convert > > The conclusion is OK, but as the invento

[PATCH v5 3/3] format-patch: teach --cover-from-description option

2019-10-14 Thread Denton Liu
ormat-patch to accept the `--cover-from-description` option and corresponding `format.coverFromDescription` config, allowing users to populate different parts of the cover letter (including the subject now). Signed-off-by: Denton Liu --- Documentation/config/format.txt| 6 + Documentation/git-f

[PATCH v5 0/3] format-patch: learn --cover-from-description option

2019-10-14 Thread Denton Liu
lt value for format.coverLetter (since format.inferCoverSubject was borrowed from this config but it also did not state what the default value was) * In 1/4, rename all instances of "expected" to "expect" Denton Liu (3): format-patch: change erroneous and condition format-

[PATCH v5 2/3] format-patch: use enum variables

2019-10-14 Thread Denton Liu
Before, `thread` and `config_cover_letter` were defined as ints even though they behaved as enums. Define actual enums and change these variables to use these new definitions. Signed-off-by: Denton Liu --- Hi Junio, I double-checked and made sure that there is no arithmetic done on the new enums

[PATCH v5 1/3] format-patch: change erroneous and condition

2019-10-14 Thread Denton Liu
SHALLOW` is a no-op. In Python, `x and y` is equivalent to `y if x else x`[1]. Since this seems to be a Python-ism that's mistakenly leaked into our code, convert this to the equivalent C expression. [1]: https://docs.python.org/3/reference/expressions.html#boolean-operations Sign

[PATCH v4 4/3] fixup! format-patch: teach --cover-from-description option

2019-10-11 Thread Denton Liu
Signed-off-by: Denton Liu --- Documentation/git-format-patch.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 86114e4c22..4c652c97f5 100644 --- a/Documentation/git-format-patch.txt +++ b

[PATCH v4 0/3] format-patch: learn --cover-from-description option

2019-10-11 Thread Denton Liu
since v1: * Incorporate Eric's suggestions for cleanup in all patches * Add patch 3/4 to make it clear what is the default value for format.coverLetter (since format.inferCoverSubject was borrowed from this config but it also did not state what the default value was) * In 1/4, rena

[PATCH v4 2/3] format-patch: use enum variables

2019-10-11 Thread Denton Liu
Before, `thread` and `config_cover_letter` were defined as ints even though they behaved as enums. Define actual enums and change these variables to use these new definitions. Signed-off-by: Denton Liu --- builtin/log.c | 30 +- 1 file changed, 17 insertions(+), 13

[PATCH v4 1/3] format-patch: remove erroneous and condition

2019-10-11 Thread Denton Liu
SHALLOW` is a no-op. Remove this erroneous and condition. Signed-off-by: Denton Liu --- builtin/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/log.c b/builtin/log.c index 44b10b3415..7d658cecef 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -835,7 +835

[PATCH v4 3/3] format-patch: teach --cover-from-description option

2019-10-11 Thread Denton Liu
ormat-patch to accept the `--cover-from-description` option and corresponding `format.coverFromDescription` config, allowing users to populate different parts of the cover letter (including the subject now). Signed-off-by: Denton Liu --- Documentation/config/format.txt| 6 + Documentation/git-f

Re: [PATCH 01/11] graph: automatically track visible width of `strbuf`

2019-10-10 Thread Denton Liu
On Fri, Oct 11, 2019 at 10:42:20AM +0900, Junio C Hamano wrote: > Denton Liu writes: > > > static int calculate_width(const struct strbuf *row) > > { > > int in_termcode = 0; > > int width = 0; > > int i; > >

Re: [PATCH 01/11] graph: automatically track visible width of `strbuf`

2019-10-10 Thread Denton Liu
Hi Dscho, On Thu, Oct 10, 2019 at 11:07:35PM +0200, Johannes Schindelin wrote: > Hi James, > > On Thu, 10 Oct 2019, James Coglan via GitGitGadget wrote: > > > From: James Coglan > > > > All the output functions in `graph.c` currently keep track of how many > > printable chars they've written to

[PATCH] pthread.h: manually align parameter lists

2019-10-10 Thread Denton Liu
no output. Signed-off-by: Denton Liu --- I missed a step in 'dl/compat-cleanup'. This patch can be applied on the tip of that branch. compat/win32/pthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h index f1cfe73de

Re: [PATCH 11/11] graph: fix coloring of octopus dashes

2019-10-10 Thread Denton Liu
On Thu, Oct 10, 2019 at 11:16:24AM -0700, Denton Liu wrote: > You can see the results of this by doing: > > $ git fetch https://github.com/Denton-L/git.git testing/graph-output > $ git diff FETCH_HEAD^2 t/t4214-log-graph-octopus.sh > > and the resulting diff is ver

Re: [PATCH 11/11] graph: fix coloring of octopus dashes

2019-10-10 Thread Denton Liu
n). > > test_expect_success 'log --graph with normal octopus merge, no color' ' So, I decided to merge 'dl/octopus-graph-bug' with your branch and I couldn't be happier! I had to make a couple of minor tweaks to the existing test cases but most of them only involved flipping `test_expect_failure` to `test_expect_success`. You can see the results of this by doing: $ git fetch https://github.com/Denton-L/git.git testing/graph-output $ git diff FETCH_HEAD^2 t/t4214-log-graph-octopus.sh and the resulting diff is very pleasing imo. Junio, when you pick this topic up, that branch should contain the correct conflict resolution if that can help you out in any way. Anyway, thanks for the work, James! I'll give this patch my: Tested-by: Denton Liu > -- > gitgitgadget

Re: [PATCH 1/1] commit: add support to provide --coauthor

2019-10-10 Thread Denton Liu
On Thu, Oct 10, 2019 at 01:49:03PM +0200, Johannes Schindelin wrote: > Hi, > > On Wed, 9 Oct 2019, Jeff King wrote: > > > On Wed, Oct 09, 2019 at 11:19:47AM +0900, Junio C Hamano wrote: > > > > > > I wonder how we are supposed to use this trailer in the Git project, > > > > in particular in combi

[PATCH] Makefile: respect $(V) in %.cocci.patch target

2019-10-09 Thread Denton Liu
ff-by: Denton Liu --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c99361e719..ae45bfc429 100644 --- a/Makefile +++ b/Makefile @@ -1890,6 +1890,7 @@ ifndef V QUIET_SP = @echo ' ' SP $<; QUIET_HDR

[PATCH v2] t0000: cover GIT_SKIP_TESTS blindspots

2019-10-08 Thread Denton Liu
Currently, the tests for GIT_SKIP_TESTS do not cover the situation where we skip an entire test suite. The tests also do not cover the situation where we have GIT_SKIP_TESTS defined but the test suite does not match. Add two test cases so we cover this blindspot. Signed-off-by: Denton Liu

[PATCH] t4014: treat rev-list output as the expected value

2019-10-08 Thread Denton Liu
. Helped-by: SZEDER Gábor Signed-off-by: Denton Liu --- Thanks for point out my mistake, Szeder. This patch can be applied to the tip of 'dl/format-patch-doc-test-cleanup' and then we should base Bert's changes on top of this branch. t/t4014-format-patch.sh | 5 +++-- 1

Re: [PATCH 1/1] commit: add support to provide --coauthor

2019-10-08 Thread Denton Liu
Welcome to the Git community, Toon! Wow, I never realised that people actually read my braindump of issues on GGG. Thanks for taking this on. First some housekeeping, when formatting your patches, it's a good idea to use `git format-patch --thread` so that your patches are grouped together by thr

[PATCH] git-rev-list.txt: prune options in synopsis

2019-10-04 Thread Denton Liu
synopsis is not only annoying but actively harmful, replace it with `[]` so users know to explicitly look through the documentation for further information. While we're at it, update the optional path notation so that it is more modern. Signed-off-by: Denton Liu --- I initially wrote a pat

[PATCH] apply: tell user location of corrupted patch file

2019-10-04 Thread Denton Liu
oid breaking Junio's workflow since he's probably one of the most frequent user of `git am` in the world. ;) Signed-off-by: Denton Liu --- apply.c| 2 +- t/t4012-diff-binary.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apply.c b/apply.c index

[PATCH v2 3/5] t4214: generate expect in their own test cases

2019-10-03 Thread Denton Liu
color" and "log --graph with tricky octopus merge with colors" so that the "no color" version appears first. This patch is best viewed with `--color-moved`. Signed-off-by: Denton Liu --- t/t4214-log-graph-octopus.sh | 42 ++-- 1 file

[PATCH v2 2/5] t4214: use test_merge

2019-10-03 Thread Denton Liu
In the previous commit, we extended test_merge() so that it could perform octopus merges. Now that the restriction is lifted, use test_merge() to perform the octopus merge instead of manually duplicating test_merge() functionality. Signed-off-by: Denton Liu --- t/t4214-log-graph-octopus.sh | 3

[PATCH v2 0/5] t4214: cleanup and demonstrate graph bug

2019-10-03 Thread Denton Liu
. I tried my hand at fixing the bug but in the hour I spent going at it, I couldn't fix the logic up. The buggy logic is in graph.c: graph_draw_octopus_merge() in case anyone is interested. Changes since v1: * Add a few more test cases to demonstrate more failure (and passing) conditions

[PATCH v2 4/5] t4214: explicitly list tags in log

2019-10-03 Thread Denton Liu
In a future test case, we will be extending the commit graph. As a result, explicitly list the tags that will generate the graph so that when future additions are made, the current graph illustrations won't be affected. Signed-off-by: Denton Liu --- t/t4214-log-graph-octopus.sh | 8 --

[PATCH v2 5/5] t4214: demonstrate octopus graph coloring failure

2019-10-03 Thread Denton Liu
reaks existing operation. Signed-off-by: Denton Liu --- t/t4214-log-graph-octopus.sh | 282 ++- 1 file changed, 281 insertions(+), 1 deletion(-) diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh index 097151da39..3ae8e51e50 100755 --- a/t/t421

[PATCH v2 1/5] test-lib: let test_merge() perform octopus merges

2019-10-03 Thread Denton Liu
Currently test_merge() only allows developers to merge in one branch. However, this restriction is artificial and there is no reason why it needs to be this way. Extend test_merge() to allow the specification of multiple branches so that octopus merges can be performed. Signed-off-by: Denton Liu

Re: [PATCH 1/3] format-patch: document and exercise that -o does only create the trailing directory

2019-10-02 Thread Denton Liu
Hi Bert, > Subject: format-patch: document and exercise that -o does only create the > trailing directory s/does only create/only creates/ ? Anyway, as a prepatory patch, I don't think that it's necessary. Maybe it's just me but I assume that most tools create at most one directory deep. Even m

  1   2   3   4   5   6   7   >