[PATCH v4 10/11] built-in add -i: use color in the main loop

2019-08-27 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic The error messages as well as the unique prefixes are colored in `git add -i` by default; We need to do the same in the built-in version. Signed-off-by: Slavica Djukic Signed-off-by: Johannes Schindelin --- add-interactive.c | 37 - 1

[PATCH v4 07/11] Add a function to determine unique prefixes for a list of strings

2019-08-27 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic In the `git add -i` command, we show unique prefixes of the commands and files, to give an indication what prefix would select them. Naturally, the C implementation looks a lot different than the Perl implementation: in Perl, a trie is much easier implemented, while we

[PATCH v4 08/11] built-in add -i: show unique prefixes of the commands

2019-08-27 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Just like in the Perl script `git-add--interactive.perl`, for each command a unique prefix is determined (if there exists any within the given parameters), and shown in the list, and accepted as a shortcut for the command. We use the prefix map implementation that we just

[PATCH v3 10/11] built-in add -i: use color in the main loop

2019-07-16 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic The error messages as well as the unique prefixes are colored in `git add -i` by default; We need to do the same in the built-in version. Signed-off-by: Slavica Djukic Signed-off-by: Johannes Schindelin --- add-interactive.c | 37 - 1

[PATCH v3 08/11] built-in add -i: show unique prefixes of the commands

2019-07-16 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Just like in the Perl script `git-add--interactive.perl`, for each command a unique prefix is determined (if there exists any within the given parameters), and shown in the list, and accepted as a shortcut for the command. We use the prefix map implementation that we just

[PATCH v3 07/11] Add a function to determine unique prefixes for a list of strings

2019-07-16 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic In the `git add -i` command, we show unique prefixes of the commands and files, to give an indication what prefix would select them. Naturally, the C implementation looks a lot different than the Perl implementation: in Perl, a trie is much easier implemented, while we

[PATCH v2 08/11] built-in add -i: show unique prefixes of the commands

2019-05-13 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Just like in the Perl script `git-add--interactive.perl`, for each command a unique prefix is determined (if there exists any within the given parameters), and shown in the list, and accepted as a shortcut for the command. We use the prefix map implementation that we just

[PATCH v2 07/11] Add a function to determine unique prefixes for a list of strings

2019-05-13 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic In the `git add -i` command, we show unique prefixes of the commands and files, to give an indication what prefix would select them. Naturally, the C implementation looks a lot different than the Perl implementation: in Perl, a trie is much easier implemented, while we

[PATCH v2 10/11] built-in add -i: use color in the main loop

2019-05-13 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic The error messages as well as the unique prefixes are colored in `git add -i` by default; We need to do the same in the built-in version. Signed-off-by: Slavica Djukic Signed-off-by: Johannes Schindelin --- add-interactive.c | 37 - 1

[PATCH 08/11] built-in add -i: show unique prefixes of the commands

2019-04-10 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Just like in the Perl script `git-add--interactive.perl`, for each command a unique prefix is determined (if there exists any within the given parameters), and shown in the list, and accepted as a shortcut for the command. We use the prefix map implementation that we just

[PATCH 10/11] built-in add -i: use color in the main loop

2019-04-10 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic The error messages as well as the unique prefixes are colored in `git add -i` by default; We need to do the same in the built-in version. Signed-off-by: Slavica Djukic Signed-off-by: Johannes Schindelin --- add-interactive.c | 40

[PATCH 07/11] Add a function to determine unique prefixes for a list of strings

2019-04-10 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic In the `git add -i` command, we show unique prefixes of the commands and files, to give an indication what prefix would select them. Naturally, the C implementation looks a lot different than the Perl implementation: in Perl, a trie is much easier implemented, while we

End of Outreachy internship

2019-03-04 Thread Slavica Djukic
d thanks to Johannes Schindelin, who turned out to be the most amazing mentor. -Slavica Djukic On 20-Feb-19 12:41 PM, Slavica Đukić via GitGitGadget wrote: This is the first version of a patch series to start porting git-add--interactive from Perl to C. Daniel Ferreira's patch series us

Re: [PATCH v5 04/10] add-interactive.c: implement list_and_choose

2019-03-01 Thread Slavica Djukic
On 22-Feb-19 10:46 PM, Junio C Hamano wrote: "Slavica Djukic via GitGitGadget" writes: +#define HEADER_INDENT " " + enum collection_phase { WORKTREE, INDEX @@ -27,6 +29,61 @@ struct collection_status { struct hashmap file_

Re: [PATCH v5 05/10] add-interactive.c: implement status command

2019-03-01 Thread Slavica Djukic
On 22-Feb-19 11:11 PM, Junio C Hamano wrote: "Slavica Djukic via GitGitGadget" writes: +static int parse_color_slot(const char *slot) +{ + if (!strcasecmp(slot, "prompt")) + return COLOR_PROMPT; + if (!strcasecmp(slot, "header")) +

Re: [PATCH v5 03/10] add-interactive.c: implement list_modified

2019-02-22 Thread Slavica Djukic
On 21-Feb-19 9:27 PM, Junio C Hamano wrote: Junio C Hamano writes: A few things I missed in the previous message. + for (i = 0; i < stat.nr; i++) { + struct file_stat *entry; + const char *name = stat.files[i]->name; + unsigned int hash = strh

Re: [PATCH v5 03/10] add-interactive.c: implement list_modified

2019-02-22 Thread Slavica Djukic
On 21-Feb-19 8:06 PM, Junio C Hamano wrote: "Slavica Djukic via GitGitGadget" writes: diff --git a/add-interactive.c b/add-interactive.c new file mode 100644 index 00..7d096207d4 --- /dev/null +++ b/add-interactive.c @@ -0,0 +1,188 @@ +#include "cache.h"

Re: [PATCH v5 01/10] diff: export diffstat interface

2019-02-22 Thread Slavica Djukic
Hello Junio, Thank you for suggestions and for taking time to look at this patch series. On 21-Feb-19 6:53 PM, Junio C Hamano wrote: "Daniel Ferreira via GitGitGadget" writes: @@ -6001,12 +5985,7 @@ void diff_flush(struct diff_options *options) dirstat_by_line) {

[PATCH v5 04/10] add-interactive.c: implement list_and_choose

2019-02-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic This is one of the two functions translated from Perl script, besides list_modified that will be used by *_cmd functions (including status) to collect index/worktree changes, list those changes and let user make a choice. At this point, it only prints worktree and index

[PATCH v5 07/10] add-interactive.c: add support for list_only option

2019-02-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic If list_only option is not set, (i.e. we want to pick elements from the list, not just display them), highlight unique prefixes of list elements and let user make a choice as shown in prompt_help_cmd and singleton_prompt_help_cmd. Input that is expected from user is full

[PATCH v5 08/10] add-interactive.c: implement show-help command

2019-02-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Implement show-help command in add-interactive.c and use it in builtin add--helper.c. Use command name "show-help" instead of "help": add--helper is builtin, hence add--helper --help would be intercepted by handle_builtin and re-routed to the help c

[PATCH v5 09/10] t3701-add-interactive: test add_i_show_help()

2019-02-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Add test to t3701-add-interactive to verify that add_i_show_help() outputs expected content. Also, add it before changing git-add--interactive.perl's help_cmd to demonstrate that there are no changes introduced by the conversion to C. Prefix git add -i call

[PATCH v5 10/10] add--interactive.perl: use add--helper --show-help for help_cmd

2019-02-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper. If an error occurs, it will be reported, but the Perl script will not exit, since the add--helper is called within an eval block. Just like the change where the Perl script

[PATCH v5 03/10] add-interactive.c: implement list_modified

2019-02-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Implement list_modified from Perl, which will be used by most of the *_cmd functions, including status in the following commit. It lists a numstat comparing changed files between a) the worktree and the index; b) the index and the HEAD. To do so, we use run_diff_index

[PATCH v5 05/10] add-interactive.c: implement status command

2019-02-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Implement add --interactive's status command in add-interactive.c and use it in builtin add--helper.c. This is the first interactive add command implemented in C of those anticipated by the previous commit, which introduced the add--helper built-in. Implement addit

Re: [PATCH v4 0/7] Turn git add-i into built-in

2019-01-25 Thread Slavica Djukic
tive add add-interactive.c: implement status command add--interactive.perl: use add--helper --status for status_cmd Slavica Djukic (3): add-interactive.c: implement show-help command t3701-add-interactive: test add_i_show_help() add--interactive.perl: use add--helper --show-help for help_cm

[PATCH v4 7/7] add--interactive.perl: use add--helper --show-help for help_cmd

2019-01-25 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper. If an error occurs, it will be reported, but the Perl script will not exit, since the add--helper is called within an eval block. Just like the change where the Perl script

[PATCH v4 5/7] add-interactive.c: implement show-help command

2019-01-25 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Implement show-help command in add-interactive.c and use it in builtin add--helper.c. Use command name "show-help" instead of "help": add--helper is builtin, hence add--helper --help would be intercepted by handle_builtin and re-routed to the help c

[PATCH v4 6/7] t3701-add-interactive: test add_i_show_help()

2019-01-25 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Add test to t3701-add-interactive to verify that add_i_show_help() outputs expected content. Also, add it before changing git-add--interactive.perl's help_cmd to demonstrate that there are no changes introduced by the conversion to C. Prefix git add -i call

Re: [PATCH v3 6/7] t3701-add-interactive: test add_i_show_help()

2019-01-25 Thread Slavica Djukic
Thanks for checking the test. I had no idea that this might happen. I'll send new iteration soon, along with this changes. -Slavica Best Wishes Phillip On 21/01/2019 09:13, Slavica Djukic via GitGitGadget wrote: From: Slavica Djukic Add test to t3701-add-interactive to verify t

Re: [PATCH v3 7/7] add--interactive.perl: use add--helper --show-help for help_cmd

2019-01-21 Thread Slavica Djukic
Hello Ævar, thanks for taking time and making review. On 21-Jan-19 10:59 AM, Ævar Arnfjörð Bjarmason wrote: On Mon, Jan 21 2019, Slavica Djukic via GitGitGadget wrote: From: Slavica Djukic Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper

[PATCH v3 5/7] add-interactive.c: implement show-help command

2019-01-21 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Implement show-help command in add-interactive.c and use it in builtin add--helper.c. Use command name "show-help" instead of "help": add--helper is builtin, hence add--helper --help would be intercepted by handle_builtin and re-routed to the help c

[PATCH v3 7/7] add--interactive.perl: use add--helper --show-help for help_cmd

2019-01-21 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper. Signed-off-by: Slavica Djukic --- git-add--interactive.perl | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/git-add--interactive.perl b/git

[PATCH v3 6/7] t3701-add-interactive: test add_i_show_help()

2019-01-21 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Add test to t3701-add-interactive to verify that add_i_show_help() outputs expected content. Also, add it before changing git-add--interactive.perl's help_cmd to demonstrate that there are no changes introduced by the conversion to C. Prefix git add -i call

Re: [PATCH v2 5/7] add-interactive.c: implement show-help command

2019-01-18 Thread Slavica Djukic
the people who commented on the previous version(s). Thanks for taking your time to review patches again. I'm sorry for omitting you in CC, but I've sent re-roll through GitGitGadget, and I guess I thought it would pick it up. I'll see what happened and keep that in mind. On 18

[PATCH v2 7/7] add--interactive.perl: use add--helper --show-help for help_cmd

2019-01-17 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper. Signed-off-by: Slavica Djukic --- git-add--interactive.perl | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/git-add--interactive.perl b/git

[PATCH v2 5/7] add-interactive.c: implement show-help command

2019-01-17 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Implement show-help command in add-interactive.c and use it in builtin add--helper.c. Use command name "show-help" instead of "help": add--helper is builtin, hence add--helper --help would be intercepted by handle_builtin and re-routed to the help c

[PATCH v2 6/7] t3701-add-interactive: test add_i_show_help()

2019-01-17 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Add test to t3701-add-interactive to verify that add_i_show_help() outputs expected content. Also, add it before changing git-add--interactive.perl's help_cmd to demonstrate that there are no changes introduced by the conversion to C. Prefix git add -i call

Re: [PATCH 6/7] Git.pm: introduce environment variable GIT_TEST_PRETEND_TTY

2019-01-15 Thread Slavica Djukic
Hi Phillip, First of all, thank you for taking your time to review this patch series. On 14-Jan-19 12:13 PM, Phillip Wood wrote: Hi Salvica/Johannes On 20/12/2018 12:09, Slavica Djukic via GitGitGadget wrote: From: Slavica Djukic To enable testing the colored output on Windows, enable TTY

Re: [PATCH 0/7] Turn git add-i into built-in

2019-01-11 Thread Slavica Djukic
234-28903-1-git-send-email-bnm...@gmail.com/t/#u Ping? :) Daniel Ferreira (4): diff: export diffstat interface add--helper: create builtin helper for interactive add add-interactive.c: implement status command add--interactive.perl: use add--helper --status for status_cmd Sl

[PATCH 5/7] add-interactive.c: implement show-help command

2018-12-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Implement show-help command in add-interactive.c and use it in builtin add--helper.c. Use command name "show-help" instead of "help": add--helper is builtin, hence add--helper --help would be intercepted by handle_builtin and re-routed to the help c

[PATCH 7/7] add--interactive.perl: use add--helper --show-help for help_cmd

2018-12-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper. Add test to t3701-add-interactive to verify that show-help outputs expected content. Use GIT_PRETENT_TTY introduced in earlier commit to be able to test output color on

[PATCH 6/7] Git.pm: introduce environment variable GIT_TEST_PRETEND_TTY

2018-12-20 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic To enable testing the colored output on Windows, enable TTY by using environment variable GIT_TEST_PRETEND_TTY. This is the original idea by Johannes Schindelin. Signed-off-by: Slavica Djukic --- color.c | 4 perl/Git.pm | 2 +- 2 files changed, 5 insertions

[Outreachy] My blog

2018-12-10 Thread Slavica Djukic
y experience as intern. -Slavica Djukic

Re: [PATCH v2 0/4] Port git-add--interactive.perl:status_cmd to C

2018-11-26 Thread Slavica Djukic
Hi Daniel, On 16-May-17 6:00 AM, Daniel Ferreira wrote: This is the second version of a patch series to start porting git-add--interactive from Perl to C. Series: v1: https://public-inbox.org/git/1494009820-2090-1-git-send-email-bnm...@gmail.com/ Travis CI build: https://travis-ci.org/theiost

[PATCH 1/1 v3] stash: tolerate missing user identity

2018-11-18 Thread Slavica Djukic
ository. Helped-by: Junio C Hamano Signed-off-by: Slavica Djukic --- git-stash.sh | 17 + t/t3903-stash.sh | 28 2 files changed, 45 insertions(+) diff --git a/git-stash.sh b/git-stash.sh index 94793c1a9..789ce2f41 100755 --- a/git-stash.sh +++

[PATCH 0/1 v3] make stash work if user.name and user.email are not configured

2018-11-18 Thread Slavica Djukic
Changes since v2: * squash patch 1/2 and patch 2/2 into a single patch * modify first part of test when there is valid ident present: create a stash, grab %an and %ae out of the resulting commit object and compare to original ident Slavica Djukic (1

Re: [PATCH v2 1/2] [Outreachy] t3903-stash: test without configured user.name and user.email

2018-11-17 Thread Slavica Djukic
Hi Junio, On 16-Nov-18 11:12 AM, Junio C Hamano wrote: Slavica Djukic writes: + git var GIT_COMMITTER_IDENT >actual && + test_cmp expected actual && I am not sure what you are testing with this step. There is nothing that changed environment variables or con

Re: [PATCH v2 1/2] [Outreachy] t3903-stash: test without configured user.name and user.email

2018-11-16 Thread Slavica Djukic
Hi Junio, On 16-Nov-18 6:55 AM, Junio C Hamano wrote: Slavica Djukic writes: +test_expect_failure 'stash works when user.name and user.email are not set' ' + git reset && + git var GIT_COMMITTER_IDENT >expected && All the other existing

[PATCH v2 2/2] [Outreachy] stash: tolerate missing user identity

2018-11-14 Thread Slavica Djukic
e stashes in a more permanent history by committing, and they must do "git config user.{name,email}" at that point anyway, so arguably this change is only delaying a step that is necessary to work in the repository. Helped-by: Junio C Hamano Signed-off-by: Slavica Djukic --- git-stash.sh |

[PATCH v2 1/2] [Outreachy] t3903-stash: test without configured user.name and user.email

2018-11-14 Thread Slavica Djukic
Add test to document that stash fails if user.name and user.email are not configured. In the later commit, test will be updated to expect success. Signed-off-by: Slavica Djukic --- t/t3903-stash.sh | 23 +++ 1 file changed, 23 insertions(+) diff --git a/t/t3903-stash.sh b/t

[PATCH v2 0/2] [Outreachy] make stash work if user.name and user.email are not configured

2018-11-14 Thread Slavica Djukic
Changes since v1: *extend test to check whether git stash executes under valid ident (and not under fallback one) when there is such present *add prepare_fallback_ident() function to git-stash.sh to provide fallback identity Slavica Djukic (2

[PATCH 3/3] [Outreachy] stash: use set_fallback_ident() function

2018-11-01 Thread Slavica Djukic
also users who find this convinient. For example, in this thread: https://public-inbox.org/git/87o9debty4@evledraar.gmail.com/T/#ma4fb50903a54cbcdecd4ef05856bf8094bc3c323 user points out that he would find it useful if stash had --author option. Signed-off-by: Slavica Djukic --- builtin

[PATCH 2/3] [Outreachy] ident: introduce set_fallback_ident() function

2018-11-01 Thread Slavica Djukic
back_ident(), which will pre-load the ident. In following commit, set_fallback_ident() function will be called in stash. Signed-off-by: Slavica Djukic --- cache.h | 1 + ident.c | 17 + 2 files changed, 18 insertions(+) diff --git a/cache.h b/cache.h index 681307f716..6b5b559a05 10

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

2018-11-01 Thread Slavica Djukic
Add test to assert that stash fails if user.name and user.email are not configured. In the final commit, test will be updated to expect success. Signed-off-by: Slavica Djukic --- t/t3903-stash.sh | 15 +++ 1 file changed, 15 insertions(+) diff --git a/t/t3903-stash.sh b/t/t3903

[PATCH 0/3] [Outreachy] make stash work if user.name and user.email are not configured

2018-11-01 Thread Slavica Djukic
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. Sla

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 config

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

2018-10-25 Thread Slavica Djukic
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.

[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

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

2018-10-24 Thread Slavica Djukic
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 | 13 + 1 file changed, 13 insertions(+) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 9e06494ba0..048998d5

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

2018-10-24 Thread Slavica Djukic
Changes since v1: *changed test title *removed subshell and HOME override *fixed weird identation *unset() replaced with sane_unset() Slavica (1): [Outreachy] t3903-stash: test without configured user name t/t3903-stash.sh | 13 + 1 file changed, 13 insertions(+)