[PATCH v12 17/26] stash: convert create to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
Add stash create to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 453 +++- git-stash.sh| 2 +- 2 files changed, 453 insertions(+), 2 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash

[PATCH v12 25/26] stash: optionally use the scripted version again

2018-12-20 Thread Paul-Sebastian Ungureanu
From: Johannes Schindelin We recently converted the `git stash` command from Unix shell scripts to builtins. Let's end users a way out when they discover a bug in the builtin command: `stash.useBuiltin`. As the file name `git-stash` is already in use, let's rename the scripted backend to `git-l

[PATCH v12 23/26] stash: convert `stash--helper.c` into `stash.c`

2018-12-20 Thread Paul-Sebastian Ungureanu
alled `git stash--helper create "$@"`, then some of these changes wouldn't have been necessary. This commit also removes the word `helper` since now stash is called directly and not by a shell script. Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[PATCH v12 07/26] stash: rename test cases to be more descriptive

2018-12-20 Thread Paul-Sebastian Ungureanu
Rename some test cases' labels to be more descriptive and under 80 characters per line. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 4e83f

[PATCH v12 08/26] stash: add tests for `git stash show` config

2018-12-20 Thread Paul-Sebastian Ungureanu
This commit introduces tests for `git stash show` config. It tests all the cases where `stash.showStat` and `stash.showPatch` are unset or set to true / false. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3907-stash-show-config.sh | 83 1 file changed, 83

[PATCH v12 19/26] stash: make push -q quiet

2018-12-20 Thread Paul-Sebastian Ungureanu
There is a change in behaviour with this commit. When there was no initial commit, the shell version of stash would still display a message. This commit makes `push` to not display any message if `--quiet` or `-q` is specified. Add tests for `--quiet`. Signed-off-by: Paul-Sebastian Ungureanu

[PATCH v12 16/26] stash: convert store to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
Add stash store to the helper and delete the store_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 62 + git-stash.sh| 43 ++-- 2 files changed, 64 insertions

[PATCH v12 24/26] stash: add back the original, scripted `git stash`

2018-12-20 Thread Paul-Sebastian Ungureanu
From: Johannes Schindelin This simply copies the version as of sd/stash-wo-user-name verbatim. As of now, it is not hooked up. The next commit will change the builtin `stash` to hand off to the scripted `git stash` when `stash.useBuiltin=false`. Signed-off-by: Johannes Schindelin --- git-stas

[PATCH v12 21/26] stash: optimize `get_untracked_files()` and `check_changes()`

2018-12-20 Thread Paul-Sebastian Ungureanu
sh()` and `do_push_stash()`). This way `check_changes()` and `get_untracked files()` are called only one time. https://public-inbox.org/git/20180818223329.gj11...@hank.intra.tgummerer.com/ Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 53 +++

[PATCH v12 26/26] tests: add a special setup where stash.useBuiltin is off

2018-12-20 Thread Paul-Sebastian Ungureanu
From: Johannes Schindelin Add a GIT_TEST_STASH_USE_BUILTIN=false test mode which is equivalent to running with stash.useBuiltin=false. This is needed to spot that we're not introducing any regressions in the legacy stash version while we're carrying both it and the new built-in version. This imi

[PATCH v12 10/26] stash: convert apply to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
when it is complete it can simply be renamed and the shell script deleted. Delete the contents of the apply_stash shell function and replace it with a call to stash--helper apply until pop is also converted. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[PATCH v12 00/26] Convert "git stash" to C builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
y" stash: add back the original, scripted `git stash` stash: optionally use the scripted version again tests: add a special setup where stash.useBuiltin is off Paul-Sebastian Ungureanu (17): sha1-name.c: add `get_oidf()` which acts like `get_oid()` strbuf.c: add `strbuf_join_argv()`

[PATCH v12 14/26] stash: convert list to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
Add stash list to the helper and delete the list_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 31 +++ git-stash.sh| 7 +-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v12 04/26] ident: add the ability to provide a "fallback identity"

2018-12-20 Thread Paul-Sebastian Ungureanu
From: Johannes Schindelin In 3bc2111fc2e9 (stash: tolerate missing user identity, 2018-11-18), `git stash` learned to provide a fallback identity for the case that no proper name/email was given (and `git stash` does not really care about a correct identity anyway, but it does want to create a co

[PATCH v12 18/26] stash: convert push to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
Add stash push to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 245 +++- git-stash.sh| 6 +- 2 files changed, 245 insertions(+), 6 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v12 12/26] stash: convert branch to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 46 + git-stash.sh| 17 ++- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index

[PATCH v12 05/26] stash: improve option parsing test coverage

2018-12-20 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb In preparation for converting the stash command incrementally to a builtin command, this patch improves test coverage of the option parsing. Both for having too many parameters, or too few. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903

[PATCH v12 09/26] stash: mention options in `show` synopsis

2018-12-20 Thread Paul-Sebastian Ungureanu
Mention in the documentation, that `show` accepts any option known to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- Documentation/git-stash.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index

[PATCH v12 15/26] stash: convert show to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
C, both options are passed further to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 87 ++ git-stash.sh| 132 +--- 2 files changed, 88 insertions(+), 131 deletions(-) diff --git a

[PATCH v12 13/26] stash: convert pop to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash pop to the helper and delete the pop_stash, drop_stash, assert_stash_ref functions from the shell script now that they are no longer needed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 39

[PATCH v12 20/26] stash: convert save to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
Add stash save to the helper and delete functions which are no longer needed (`show_help()`, `save_stash()`, `push_stash()`, `create_stash()`, `clear_stash()`, `untracked_files()` and `no_changes()`). Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 50 ++ git-stash.sh

[PATCH v12 22/26] stash: replace all `write-tree` child processes with API calls

2018-12-20 Thread Paul-Sebastian Ungureanu
This commit replaces spawning `git write-tree` with API calls. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 41 - 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v12 02/26] strbuf.c: add `strbuf_join_argv()`

2018-12-20 Thread Paul-Sebastian Ungureanu
Implement `strbuf_join_argv()` to join arguments into a strbuf. Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 15 +++ strbuf.h | 7 +++ 2 files changed, 22 insertions(+) diff --git a/strbuf.c b/strbuf.c index f6a6cf78b9..82e90f1dfe 100644 --- a/strbuf.c +++ b/strbuf.c

[PATCH v12 06/26] t3903: modernize style

2018-12-20 Thread Paul-Sebastian Ungureanu
Remove whitespaces after redirection operators and wrap long lines. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index

[PATCH v12 11/26] stash: convert drop and clear to builtin

2018-12-20 Thread Paul-Sebastian Ungureanu
are not valid when the commands are called externally. Once pop is converted they can both be removed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 117 git-stash.sh| 4 +- 2 files

[PATCH v12 01/26] sha1-name.c: add `get_oidf()` which acts like `get_oid()`

2018-12-20 Thread Paul-Sebastian Ungureanu
Compared to `get_oid()`, `get_oidf()` has as parameters a pointer to `object_id`, a printf format string and additional arguments. This will help simplify the code in subsequent commits. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- cache.h | 1 + sha1

[PATCH v12 03/26] strbuf.c: add `strbuf_insertf()` and `strbuf_vinsertf()`

2018-12-20 Thread Paul-Sebastian Ungureanu
Implement `strbuf_insertf()` and `strbuf_vinsertf()` to insert data using a printf format string. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 36 strbuf.h | 9 + 2 files changed, 45 insertions

[PATCH v11 14/22] stash: convert show to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
C, both options are passed further to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 87 ++ git-stash.sh| 132 +--- 2 files changed, 88 insertions(+), 131 deletions(-) diff --git a

[PATCH v11 20/22] stash: convert `stash--helper.c` into `stash.c`

2018-11-22 Thread Paul-Sebastian Ungureanu
alled `git stash--helper create "$@"`, then some of these changes wouldn't have been necessary. This commit also removes the word `helper` since now stash is called directly and not by a shell script. Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[PATCH v11 15/22] stash: convert store to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
Add stash store to the helper and delete the store_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 62 + git-stash.sh| 43 ++-- 2 files changed, 64 insertions

[PATCH v11 16/22] stash: convert create to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
Add stash create to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 451 +++- git-stash.sh| 2 +- 2 files changed, 451 insertions(+), 2 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash

[PATCH v11 01/22] sha1-name.c: add `get_oidf()` which acts like `get_oid()`

2018-11-22 Thread Paul-Sebastian Ungureanu
Compared to `get_oid()`, `get_oidf()` has as parameters a pointer to `object_id`, a printf format string and additional arguments. This will help simplify the code in subsequent commits. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- cache.h | 1 + sha1

[PATCH v11 02/22] strbuf.c: add `strbuf_join_argv()`

2018-11-22 Thread Paul-Sebastian Ungureanu
Implement `strbuf_join_argv()` to join arguments into a strbuf. Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 15 +++ strbuf.h | 7 +++ 2 files changed, 22 insertions(+) diff --git a/strbuf.c b/strbuf.c index f6a6cf78b9..82e90f1dfe 100644 --- a/strbuf.c +++ b/strbuf.c

[PATCH v11 10/22] stash: convert drop and clear to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
are not valid when the commands are called externally. Once pop is converted they can both be removed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 117 git-stash.sh| 4 +- 2 files

[PATCH v11 21/22] stash: optimize `get_untracked_files()` and `check_changes()`

2018-11-22 Thread Paul-Sebastian Ungureanu
sh()` and `do_push_stash()`). This way `check_changes()` and `get_untracked files()` are called only one time. https://public-inbox.org/git/20180818223329.gj11...@hank.intra.tgummerer.com/ Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash.c | 50 ---

[PATCH v11 12/22] stash: convert pop to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash pop to the helper and delete the pop_stash, drop_stash, assert_stash_ref functions from the shell script now that they are no longer needed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 39

[PATCH v11 18/22] stash: make push -q quiet

2018-11-22 Thread Paul-Sebastian Ungureanu
There is a change in behaviour with this commit. When there was no initial commit, the shell version of stash would still display a message. This commit makes `push` to not display any message if `--quiet` or `-q` is specified. Add tests for `--quiet`. Signed-off-by: Paul-Sebastian Ungureanu

[PATCH v11 11/22] stash: convert branch to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 46 + git-stash.sh| 17 ++- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index

[PATCH v11 22/22] stash: replace all `write-tree` child processes with API calls

2018-11-22 Thread Paul-Sebastian Ungureanu
This commit replaces spawning `git write-tree` with API calls. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash.c | 41 - 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index 5ad0f443ca

[PATCH v11 17/22] stash: convert push to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
Add stash push to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 245 +++- git-stash.sh| 6 +- 2 files changed, 245 insertions(+), 6 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v11 09/22] stash: convert apply to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
when it is complete it can simply be renamed and the shell script deleted. Delete the contents of the apply_stash shell function and replace it with a call to stash--helper apply until pop is also converted. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[PATCH v11 13/22] stash: convert list to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
Add stash list to the helper and delete the list_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 31 +++ git-stash.sh| 7 +-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v11 19/22] stash: convert save to builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
Add stash save to the helper and delete functions which are no longer needed (`show_help()`, `save_stash()`, `push_stash()`, `create_stash()`, `clear_stash()`, `untracked_files()` and `no_changes()`). Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 50 +++ git

[PATCH v11 06/22] stash: rename test cases to be more descriptive

2018-11-22 Thread Paul-Sebastian Ungureanu
Rename some test cases' labels to be more descriptive and under 80 characters per line. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 098a3

[PATCH v11 05/22] t3903: modernize style

2018-11-22 Thread Paul-Sebastian Ungureanu
Remove whitespaces after redirection operators and wrap long lines. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index

[PATCH v11 08/22] stash: mention options in `show` synopsis

2018-11-22 Thread Paul-Sebastian Ungureanu
Mention in the documentation, that `show` accepts any option known to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- Documentation/git-stash.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index

[PATCH v11 07/22] stash: add tests for `git stash show` config

2018-11-22 Thread Paul-Sebastian Ungureanu
This commit introduces tests for `git stash show` config. It tests all the cases where `stash.showStat` and `stash.showPatch` are unset or set to true / false. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3907-stash-show-config.sh | 83 1 file changed, 83

[PATCH v11 03/22] strbuf.c: add `strbuf_insertf()` and `strbuf_vinsertf()`

2018-11-22 Thread Paul-Sebastian Ungureanu
Implement `strbuf_insertf()` and `strbuf_vinsertf()` to insert data using a printf format string. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 36 strbuf.h | 9 + 2 files changed, 45 insertions

[PATCH v11 04/22] stash: improve option parsing test coverage

2018-11-22 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb In preparation for converting the stash command incrementally to a builtin command, this patch improves test coverage of the option parsing. Both for having too many parameters, or too few. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903

[PATCH v11 00/22] Convert "git stash" to C builtin

2018-11-22 Thread Paul-Sebastian Ungureanu
or changes (changed "!oidcmp" to "oideq") - fixed merge conflicts Best regards, Paul Joel Teichroeb (5): stash: improve option parsing test coverage stash: convert apply to builtin stash: convert drop and clear to builtin stash: convert branch to builtin stash: convert

[PATCH v10 18/21] stash: convert save to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
message. Even if this is a change in behaviour, the documentation remains the same because the `-m` parameter was omitted before. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 52 +++ git-stash.sh| 311 +--- 2 files

[PATCH v10 07/21] stash: mention options in `show` synopsis

2018-10-14 Thread Paul-Sebastian Ungureanu
Mention in the documentation, that `show` accepts any option known to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- Documentation/git-stash.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index

[PATCH v10 05/21] stash: rename test cases to be more descriptive

2018-10-14 Thread Paul-Sebastian Ungureanu
Rename some test cases' labels to be more descriptive and under 80 characters per line. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index de6ca

[PATCH v10 09/21] stash: convert drop and clear to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
are not valid when the commands are called externally. Once pop is converted they can both be removed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 117 git-stash.sh| 4 +- 2 files

[PATCH v10 16/21] stash: convert push to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash push to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 241 +++- git-stash.sh| 6 +- 2 files changed, 241 insertions(+), 6 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v10 20/21] stash: optimize `get_untracked_files()` and `check_changes()`

2018-10-14 Thread Paul-Sebastian Ungureanu
sh()` and `do_push_stash()`). This way `check_changes()` and `get_untracked files()` are called only one time. https://public-inbox.org/git/20180818223329.gj11...@hank.intra.tgummerer.com/ Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash.c | 50 ---

[PATCH v10 10/21] stash: convert branch to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 46 + git-stash.sh| 17 ++- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index

[PATCH v10 13/21] stash: convert show to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
C, both options are passed further to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 87 ++ git-stash.sh| 132 +--- 2 files changed, 88 insertions(+), 131 deletions(-) diff --git a

[PATCH v10 15/21] stash: convert create to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash create to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 458 git-stash.sh| 2 +- 2 files changed, 459 insertions(+), 1 deletion(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v10 02/21] strbuf.c: add `strbuf_join_argv()`

2018-10-14 Thread Paul-Sebastian Ungureanu
Implement `strbuf_join_argv()` to join arguments into a strbuf. Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 13 + strbuf.h | 7 +++ 2 files changed, 20 insertions(+) diff --git a/strbuf.c b/strbuf.c index 64041c3c24..c8a104099a 100644 --- a/strbuf.c +++ b/strbuf.c

[PATCH v10 19/21] stash: convert `stash--helper.c` into `stash.c`

2018-10-14 Thread Paul-Sebastian Ungureanu
alled `git stash--helper create "$@"`, then some of these changes wouldn't have been necessary. This commit also removes the word `helper` since now stash is called directly and not by a shell script. Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[PATCH v10 00/21] Convert "git stash" to C builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
apply to builtin stash: convert drop and clear to builtin stash: convert branch to builtin stash: convert pop to builtin Paul-Sebastian Ungureanu (16): sha1-name.c: add `get_oidf()` which acts like `get_oid()` strbuf.c: add `strbuf_join_argv()` t3903: modernize style stash: rename

[PATCH v10 06/21] stash: add tests for `git stash show` config

2018-10-14 Thread Paul-Sebastian Ungureanu
This commit introduces tests for `git stash show` config. It tests all the cases where `stash.showStat` and `stash.showPatch` are unset or set to true / false. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3907-stash-show-config.sh | 83 1 file changed, 83

[PATCH v10 21/21] stash: replace all `write-tree` child processes with API calls

2018-10-14 Thread Paul-Sebastian Ungureanu
This commit replaces spawning `git write-tree` with API calls. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash.c | 41 - 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index d2365ada2e

[PATCH v10 17/21] stash: make push -q quiet

2018-10-14 Thread Paul-Sebastian Ungureanu
There is a change in behaviour with this commit. When there was no initial commit, the shell version of stash would still display a message. This commit makes `push` to not display any message if `--quiet` or `-q` is specified. Add tests for `--quiet`. Signed-off-by: Paul-Sebastian Ungureanu

[PATCH v10 04/21] t3903: modernize style

2018-10-14 Thread Paul-Sebastian Ungureanu
Remove whitespaces after redirection operators and wrap long lines. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index

[PATCH v10 11/21] stash: convert pop to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash pop to the helper and delete the pop_stash, drop_stash, assert_stash_ref functions from the shell script now that they are no longer needed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 39

[PATCH v10 14/21] stash: convert store to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash store to the helper and delete the store_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 62 + git-stash.sh| 43 ++-- 2 files changed, 64 insertions

[PATCH v10 08/21] stash: convert apply to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
when it is complete it can simply be renamed and the shell script deleted. Delete the contents of the apply_stash shell function and replace it with a call to stash--helper apply until pop is also converted. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[PATCH v10 01/21] sha1-name.c: add `get_oidf()` which acts like `get_oid()`

2018-10-14 Thread Paul-Sebastian Ungureanu
Compared to `get_oid()`, `get_oidf()` has as parameters a pointer to `object_id`, a printf format string and additional arguments. This will help simplify the code in subsequent commits. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- cache.h | 1 + sha1

[PATCH v10 12/21] stash: convert list to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash list to the helper and delete the list_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 31 +++ git-stash.sh| 7 +-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v10 03/21] stash: improve option parsing test coverage

2018-10-14 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb In preparation for converting the stash command incrementally to a builtin command, this patch improves test coverage of the option parsing. Both for having too many parameters, or too few. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903

[PATCH v9 07/21] stash: convert apply to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
when it is complete it can simply be renamed and the shell script deleted. Delete the contents of the apply_stash shell function and replace it with a call to stash--helper apply until pop is also converted. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[GSoC][PATCH v9 06/21] strbuf.c: add `strbuf_join_argv()`

2018-09-25 Thread Paul-Sebastian Ungureanu
Implement `strbuf_join_argv()` to join arguments. Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 15 +++ strbuf.h | 7 +++ 2 files changed, 22 insertions(+) diff --git a/strbuf.c b/strbuf.c index 64041c3c24..3eb431b2b0 100644 --- a/strbuf.c +++ b/strbuf.c @@ -259,6

[PATCH v9 19/21] stash: convert `stash--helper.c` into `stash.c`

2018-09-25 Thread Paul-Sebastian Ungureanu
alled `git stash--helper create "$@"`, then some of these changes wouldn't have been necessary. This commit also removes the word `helper` since now stash is called directly and not by a shell script. Signed-off-by: Paul-Sebastian Ungureanu --- .gitignore

[PATCH v9 14/21] stash: convert store to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
Add stash store to the helper and delete the store_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 60 + git-stash.sh| 43 ++--- 2 files changed, 62 insertions

[PATCH v9 15/21] stash: convert create to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
Add stash create to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 450 git-stash.sh| 2 +- 2 files changed, 451 insertions(+), 1 deletion(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v9 08/21] stash: convert drop and clear to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
are not valid when the commands are called externally. Once pop is converted they can both be removed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 116 git-stash.sh| 4 +- 2 files

[PATCH v9 06/21] stash: add tests for `git stash show` config

2018-09-25 Thread Paul-Sebastian Ungureanu
This commit introduces tests for `git stash show` config. It tests all the cases where `stash.showStat` and `stash.showPatch` are unset or set to true / false. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3907-stash-show-config.sh | 83 1 file changed, 83

[PATCH v9 01/21] sha1-name.c: add `get_oidf()` which acts like `get_oid()`

2018-09-25 Thread Paul-Sebastian Ungureanu
Compared to `get_oid()`, `get_oidf()` has as parameters a pointer to `object_id`, a printf format string and additional arguments. This will help simplify the code in subsequent commits. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- cache.h | 1 + sha1

[PATCH v9 21/21] stash: replace all `write-tree` child processes with API calls

2018-09-25 Thread Paul-Sebastian Ungureanu
This commit replaces spawning `git write-tree` with API calls. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash.c | 41 - 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index 43d0de1f13

[PATCH v9 20/21] stash: optimize `get_untracked_files()` and `check_changes()`

2018-09-25 Thread Paul-Sebastian Ungureanu
sh()` and `do_push_stash()`). This way `check_changes()` and `get_untracked files()` are called only one time. https://public-inbox.org/git/20180818223329.gj11...@hank.intra.tgummerer.com/ Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash.c | 51 ---

[PATCH v9 10/21] stash: convert pop to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash pop to the helper and delete the pop_stash, drop_stash, assert_stash_ref functions from the shell script now that they are no longer needed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 38

[PATCH v9 18/21] stash: convert save to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
message. Even if this is a change in behaviour, the documentation remains the same because the `-m` parameter was omitted before. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 50 +++ git-stash.sh| 311 +--- 2 files

[PATCH v9 11/21] stash: convert list to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
Add stash list to the helper and delete the list_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 31 +++ git-stash.sh| 7 +-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v9 16/21] stash: convert push to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
Add stash push to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 244 +++- git-stash.sh| 6 +- 2 files changed, 244 insertions(+), 6 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v9 00/21] Convert "git stash" to C builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
w a little bit closer to be used as API. Joel Teichroeb (5): stash: improve option parsing test coverage stash: convert apply to builtin stash: convert drop and clear to builtin stash: convert branch to builtin stash: convert pop to builtin Paul-Sebastian Ungureanu (16): sha1-name.c: add

[GSoC][PATCH v9 05/21] stash: add tests for `git stash show` config

2018-09-25 Thread Paul-Sebastian Ungureanu
This commit introduces tests for `git stash show` config. It tests all the cases where `stash.showStat` and `stash.showPatch` are unset or set to true / false. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3907-stash-show-config.sh | 83 1 file changed, 83

[PATCH v9 13/21] stash: mention options in `show` synopsis.

2018-09-25 Thread Paul-Sebastian Ungureanu
Mention in the usage text and in the documentation, that `show` accepts any option known to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- Documentation/git-stash.txt | 4 ++-- builtin/stash--helper.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a

[PATCH v9 17/21] stash: make push -q quiet

2018-09-25 Thread Paul-Sebastian Ungureanu
There is a change in behaviour with this commit. When there was no initial commit, the shell version of stash would still display a message. This commit makes `push` to not display any message if `--quiet` or `-q` is specified. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c

[PATCH v9 09/21] stash: convert branch to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 46 + git-stash.sh| 17 ++- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index

[PATCH v9 04/21] stash: update test cases conform to coding guidelines

2018-09-25 Thread Paul-Sebastian Ungureanu
Removed whitespaces after redirection operators. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index af7586d43d..de6cab1fe7

[PATCH v9 12/21] stash: convert show to builtin

2018-09-25 Thread Paul-Sebastian Ungureanu
C, both options are passed further to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 87 ++ git-stash.sh| 132 +--- 2 files changed, 88 insertions(+), 131 deletions(-) diff --git a

[PATCH v9 02/21] strbuf.c: add `strbuf_join_argv()`

2018-09-25 Thread Paul-Sebastian Ungureanu
Implement `strbuf_join_argv()` to join arguments into a strbuf. Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 15 +++ strbuf.h | 7 +++ 2 files changed, 22 insertions(+) diff --git a/strbuf.c b/strbuf.c index 64041c3c24..3eb431b2b0 100644 --- a/strbuf.c +++ b/strbuf.c

[GSoC][PATCH v9 04/21] stash: rename test cases to be more descriptive

2018-09-25 Thread Paul-Sebastian Ungureanu
Rename some test cases' labels to be more descriptive and under 80 characters per line. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index de6ca

[PATCH v9 05/21] stash: rename test cases to be more descriptive

2018-09-25 Thread Paul-Sebastian Ungureanu
Rename some test cases' labels to be more descriptive and under 80 characters per line. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index de6ca

[GSoC][PATCH v9 02/21] stash: improve option parsing test coverage

2018-09-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb In preparation for converting the stash command incrementally to a builtin command, this patch improves test coverage of the option parsing. Both for having too many parameters, or too few. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903

[GSoC][PATCH v9 03/21] stash: update test cases conform to coding guidelines

2018-09-25 Thread Paul-Sebastian Ungureanu
Removed whitespaces after redirection operators. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index af7586d43d..de6cab1fe7

[PATCH v9 03/21] stash: improve option parsing test coverage

2018-09-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb In preparation for converting the stash command incrementally to a builtin command, this patch improves test coverage of the option parsing. Both for having too many parameters, or too few. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903

Re: [GSoC][PATCH v8 18/20] stash: convert `stash--helper.c` into `stash.c`

2018-09-25 Thread Paul-Sebastian Ungureanu
Hi, @@ -1443,9 +1448,10 @@ static int push_stash(int argc, const char **argv, const char *prefix) OPT_END() }; - argc = parse_options(argc, argv, prefix, options, -git_stash_helper_push_usage, -0); + if

  1   2   3   >