[PATCH v6 6/6] worktree: teach "add" to check out existing branches

2018-03-31 Thread Thomas Gummerer
compatibility worries here. We will still 'die()' if the branch is checked out in another worktree, unless the --force flag is passed. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- Documentation/git-worktree.txt | 9 +++-- builtin/worktree.c | 22 +++--- t

[PATCH v6 4/6] worktree: be clearer when "add" dwim-ery kicks in

2018-03-31 Thread Thomas Gummerer
and where it's nice to tell the user which kind of dwim-ery kicked in. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/worktree.c b/builtin/worktree.c index cc94325886..f686ee1440 100644 --- a/builti

[PATCH v6 0/6] worktree: teach "add" to check out existing branches

2018-03-31 Thread Thomas Gummerer
Thanks Eric for the review of the last round. Previous rounds are at <20180121120208.12760-1-t.gumme...@gmail.com>, <20180204221305.28300-1-t.gumme...@gmail.com>, <20180317220830.30963-1-t.gumme...@gmail.com>, <2018031719.4940-1-t.gumme...@gmail.com> and

[PATCH v6 2/6] reset: introduce show-new-head-line option

2018-03-31 Thread Thomas Gummerer
ternal use, which we probably don't want to advertise to our users, at least until there's a need for it, make it a hidden flag. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/reset.c | 5 - t/t7102-reset.sh | 5 + 2 files changed, 9 insertions(+), 1 deletio

[PATCH v6 1/6] worktree: remove extra members from struct add_opts

2018-03-31 Thread Thomas Gummerer
There are two members of 'struct add_opts', which are only used inside the 'add()' function, but being part of 'struct add_opts' they are needlessly also passed to the 'add_worktree' function. Make them local to the 'add()' function to make it clearer where they are used. Signed-off-by: Thomas

[PATCH v6 3/6] worktree: improve message when creating a new worktree

2018-03-31 Thread Thomas Gummerer
these inconsistencies, and no longer show the identifier by making the 'git reset --hard' call not print the "HEAD is now at ..." line using the newly introduced flag from the previous commit, and printing the message directly from the builtin command instead. Signed-off-by: Thomas Gummerer <t.gumme

Re: What's cooking in git.git (Mar 2018, #06; Fri, 30)

2018-03-30 Thread Thomas Gummerer
On 03/30, Junio C Hamano wrote: > * tg/worktree-add-existing-branch (2018-03-27) 6 commits > - t2025: rename now outdated branch name > - worktree: teach "add" to check out existing branches > - worktree: factor out dwim_branch function > - worktree: remove force_new_branch from struct

Re: [PATCH v5 0/6] worktree: teach "add" to check out existing branches

2018-03-30 Thread Thomas Gummerer
On 03/27, Eric Sunshine wrote: > On Sun, Mar 25, 2018 at 9:49 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > Thanks Eric for the review of the previous round and Duy and Junio for > > additional comments. > > This round should address all of Eric's comme

Re: [PATCH v5 5/6] worktree: teach "add" to check out existing branches

2018-03-30 Thread Thomas Gummerer
On 03/27, Eric Sunshine wrote: > On Sun, Mar 25, 2018 at 9:49 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > Currently 'git worktree add ' creates a new branch named after the > > basename of the path by default. If a branch with that name already > > exists

Re: [PATCH v5 3/6] worktree: remove force_new_branch from struct add_opts

2018-03-30 Thread Thomas Gummerer
On 03/27, Eric Sunshine wrote: > On Sun, Mar 25, 2018 at 9:49 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > The 'force_new_branch' flag in 'struct add_opts' is only used inside the > > add function, where we already have the same information stored in the > >

Re: [PATCH v5 2/6] worktree: be clearer when "add" dwim-ery kicks in

2018-03-30 Thread Thomas Gummerer
On 03/27, Eric Sunshine wrote: > On Sun, Mar 25, 2018 at 9:49 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > Currently there is no indication in the "git worktree add" output that > > a new branch was created. This would be especially useful information

[PATCH] git-stash.txt: remove extra square bracket

2018-03-26 Thread Thomas Gummerer
e man page, and removing the first extra square bracket instead of the second one makes the synopis easier to understand. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- Documentation/git-stash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation

Re: [RFC][PATCH] git-stash: convert git stash list to C builtin

2018-03-26 Thread Thomas Gummerer
On 03/26, Johannes Schindelin wrote: > Hi Eric, > > On Sun, 25 Mar 2018, Eric Sunshine wrote: > > > On Sat, Mar 24, 2018 at 2:23 PM, Paul-Sebastian Ungureanu > > wrote: > > > Currently, because git stash is not fully converted to C, I > > > introduced a new

Re: [RFC][PATCH] git-stash: convert git stash list to C builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Paul-Sebastian Ungureanu wrote: > Currently, because git stash is not fully converted to C, I > introduced a new helper that will hold the converted commands. Missing sign-off? I think it's a good idea to sign off your work even for RFC patches that you don't expect to be applied. If

Re: [PATCH 0/4] Convert some stash functionality to a builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Joel Teichroeb wrote: > I've been working on converting all of git stash to be a > builtin, however it's hard to get it all working at once with > limited time, so I've moved around half of it to a new > stash--helper builtin and called these functions from the shell > script. Once this

Re: [PATCH 4/4] stash: convert pop to builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Joel Teichroeb wrote: > --- > builtin/stash--helper.c | 38 ++ > git-stash.sh| 3 ++- > 2 files changed, 40 insertions(+), 1 deletion(-) > > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > index 1598b82ac2..b912f84c97

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Joel Teichroeb wrote: > --- > [...] > + > +static const char *ref_stash = "refs/stash"; > +static int quiet; > +static char stash_index_path[PATH_MAX]; > + > +struct stash_info { > + struct object_id w_commit; > + struct object_id b_commit; > + struct object_id i_commit; > +

Re: [PATCH 2/4] stash: convert branch to builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Joel Teichroeb wrote: > --- > builtin/stash--helper.c | 44 > git-stash.sh| 3 ++- > 2 files changed, 46 insertions(+), 1 deletion(-) > > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > index

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Joel Teichroeb wrote: > --- Missing sign-off? I saw it's missing in the other patches as well. > [...] > +static int do_apply_stash(const char *prefix, struct stash_info *info, int > index) > +{ > + struct merge_options o; > + struct object_id c_tree; > + struct

[PATCH v5 1/6] worktree: improve message when creating a new worktree

2018-03-25 Thread Thomas Gummerer
these inconsistencies, and no longer show the identifier by making the 'git reset --hard' call quiet, and printing the message directly from the builtin command instead. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 13 ++--- 1 file changed, 10 insertions(+), 3 del

[PATCH v5 5/6] worktree: teach "add" to check out existing branches

2018-03-25 Thread Thomas Gummerer
compatibility worries here. We will still 'die()' if the branch is checked out in another worktree, unless the --force flag is passed. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- Documentation/git-worktree.txt | 9 +++-- builtin/worktree.c | 19 +-- t

[PATCH v5 6/6] t2025: rename now outdated branch name

2018-03-25 Thread Thomas Gummerer
wonder why this particular branch is more "precious" than others. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- t/t2025-worktree-add.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh

[PATCH v5 4/6] worktree: factor out dwim_branch function

2018-03-25 Thread Thomas Gummerer
noise in the next patch. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 1e4a919a00..c296c3eacb 100644 --- a/builtin/work

[PATCH v5 0/6] worktree: teach "add" to check out existing branches

2018-03-25 Thread Thomas Gummerer
est_cmp_rev precious HEAD + cd dwim && + test_cmp_rev dwim HEAD ) ' @@ -216,6 +216,10 @@ test_expect_success '"add" auto-vivify fails with checked out branch' ' test_path_is_missing test-branch ' +test_expect_success '"add --force" with ex

[PATCH v5 2/6] worktree: be clearer when "add" dwim-ery kicks in

2018-03-25 Thread Thomas Gummerer
re it's nice to tell the user which kind of dwim-ery kicked in. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/worktree.c b/builtin/worktree.c index 535734cc7f..a082230b6c 100644 --- a/builti

[PATCH v5 3/6] worktree: remove force_new_branch from struct add_opts

2018-03-25 Thread Thomas Gummerer
The 'force_new_branch' flag in 'struct add_opts' is only used inside the add function, where we already have the same information stored in the 'new_branch_force' variable. Avoid that unnecessary duplication. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree

Re: [PATCH v4 4/4] worktree: teach "add" to check out existing branches

2018-03-24 Thread Thomas Gummerer
On 03/20, Eric Sunshine wrote: > On Sat, Mar 17, 2018 at 6:22 PM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > [...] > > However we can do a little better than that, and check the branch out if > > it is not checked out anywhere else. This will help users

Re: [PATCH v4 2/4] worktree: be clearer when "add" dwim-ery kicks in

2018-03-24 Thread Thomas Gummerer
On 03/20, Eric Sunshine wrote: > On Tue, Mar 20, 2018 at 3:26 AM, Eric Sunshine <sunsh...@sunshineco.com> > wrote: > > On Sat, Mar 17, 2018 at 6:22 PM, Thomas Gummerer <t.gumme...@gmail.com> > > wrote: > >> Currently there is no indication in the "git

Re: [PATCH v4 1/4] worktree: improve message when creating a new worktree

2018-03-24 Thread Thomas Gummerer
On 03/20, Eric Sunshine wrote: > On Sat, Mar 17, 2018 at 6:22 PM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > [...] > > Fix these inconsistencies, and no longer show the identifier by making > > the 'git reset --hard' call quiet, and printing the message directly &

[PATCH] stash: drop superfluos pathspec parameter (was: Re: [PATCH v5 2/3] stash push: avoid printing errors)

2018-03-21 Thread Thomas Gummerer
On 03/21, Thomas Gummerer wrote: > > Argh I just noticed we could drop the "$@" here, as this is no longer > the pathspec case. It doesn't hurt anything, except it may be a bit > confusing when reading the code. > > Although if we end up implementing 'git checkout -

Re: [PATCH v5 2/3] stash push: avoid printing errors

2018-03-21 Thread Thomas Gummerer
On 03/20, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > ... > > Fix this by avoiding the 'git clean' if a pathspec is given, and use the > > pipeline that's used for pathspec mode to get rid of the untracked files > > as well. &g

[PATCH v5 2/3] stash push: avoid printing errors

2018-03-19 Thread Thomas Gummerer
the 'git clean' if a pathspec is given, and use the pipeline that's used for pathspec mode to get rid of the untracked files as well. Reported-by: Marc Strapetz <marc.strap...@syntevo.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- git-stash.sh | 6 ++

[PATCH v5 1/3] stash: fix nonsense pipeline

2018-03-19 Thread Thomas Gummerer
From: Junio C Hamano An earlier change bba067d2 ("stash: don't delete untracked files that match pathspec", 2018-01-06) was made by taking a suggestion in a list discussion [1] but did not copy the suggested snippet correctly. And the bug was unnoticed during the review and

[PATCH v5 3/3] stash push -u: don't create empty stash

2018-03-19 Thread Thomas Gummerer
function. Reported-by: Marc Strapetz <marc.strap...@syntevo.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- git-stash.sh | 2 +- t/t3905-stash-include-untracked.sh | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/git-stash.sh

[PATCH v5 0/3] stash push -u -- fixes

2018-03-19 Thread Thomas Gummerer
pipeline to get rid of changes in untracked files as well. I'm not adding an interdiff, because Patch 2 is mostly rewritten and the other two are unchanged, so it is probably easiest to just review patch 2. Junio C Hamano (1): stash: fix nonsense pipeline Thomas Gummerer (2): stash push: avoid

Re: [PATCH v3 0/2] stash push -u -- fixes

2018-03-19 Thread Thomas Gummerer
On 03/19, Marc Strapetz wrote: > On 16.03.2018 21:43, Thomas Gummerer wrote: > >Thanks Marc for catching the regression I almost introduced and Junio > >for the review of the second patch. Here's a re-roll that should fix > >the issues of v2. > > Thanks, existing is

[PATCH v4 4/4] worktree: teach "add" to check out existing branches

2018-03-17 Thread Thomas Gummerer
compatibility worries here. We will still 'die()' if the branch is checked out in another worktree, unless the --force flag is passed. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- Documentation/git-worktree.txt | 9 +++-- builtin/worktree.c | 21 ++--- t

[PATCH v4 3/4] worktree: factor out dwim_branch function

2018-03-17 Thread Thomas Gummerer
noise in the next patch. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 2266c132f9..52049b447a 100644 --- a/builtin/work

[PATCH v4 1/4] worktree: improve message when creating a new worktree

2018-03-17 Thread Thomas Gummerer
these inconsistencies, and no longer show the identifier by making the 'git reset --hard' call quiet, and printing the message directly from the builtin command instead. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 13 ++--- 1 file changed, 10 insertions(+), 3 del

[PATCH v4 2/4] worktree: be clearer when "add" dwim-ery kicks in

2018-03-17 Thread Thomas Gummerer
re it's nice to tell the user which kind of dwim-ery kicked in. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/worktree.c b/builtin/worktree.c index e5d04f0b4b..2266c132f9 100644 --- a/builti

[PATCH v4 0/4] worktree: teach "add" to check out existing branches

2018-03-17 Thread Thomas Gummerer
branch = remote; - } - } - strbuf_release(); + const char *dwim_branchname = dwim_branch(path, ); + if (dwim_branchname) + branch = dwim_branchname; } if (ac == 2 &&

[PATCH v3 4/4] worktree: teach "add" to check out existing branches

2018-03-17 Thread Thomas Gummerer
compatibility worries here. We will still 'die()' if the branch is checked out in another worktree, unless the --force flag is passed. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- Documentation/git-worktree.txt | 9 +++-- builtin/worktree.c | 22 +++--- t

[PATCH v3 0/4] worktree: teach "add" to check out existing branches

2018-03-17 Thread Thomas Gummerer
- unique_tracking_name(opts.new_branch, ); - if (remote) - branch = remote; - } - } - strbuf_release(); + const char *dwim_branchname = dwim_

[PATCH v3 1/4] worktree: improve message when creating a new worktree

2018-03-17 Thread Thomas Gummerer
these inconsistencies, and no longer show the identifier by making the 'git reset --hard' call quiet, and printing the message directly from the builtin command instead. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 13 ++--- 1 file changed, 10 insertions(+), 3 del

[PATCH v3 3/4] worktree: factor out dwim_branch function

2018-03-17 Thread Thomas Gummerer
noise in the next patch. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 2266c132f9..52049b447a 100644 --- a/builtin/work

[PATCH v3 2/4] worktree: be clearer when "add" dwim-ery kicks in

2018-03-17 Thread Thomas Gummerer
re it's nice to tell the user which kind of dwim-ery kicked in. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/worktree.c b/builtin/worktree.c index e5d04f0b4b..2266c132f9 100644 --- a/builti

Re: [RFC PATCH] git-submodule.sh:cmd_update: if submodule branch exists, fetch that instead of default

2018-03-17 Thread Thomas Gummerer
On 03/17, Eddy Petrișor wrote: > vin., 16 mar. 2018, 23:44 Eric Sunshine <sunsh...@sunshineco.com> a scris: > > > On Fri, Mar 16, 2018 at 5:33 PM, Thomas Gummerer <t.gumme...@gmail.com> > > wrote: > > > a/Documentation/SubmittingPatches b/Documentation/S

Re: [PATCH v4 0/3] stash push -u -- fixes

2018-03-17 Thread Thomas Gummerer
didn't make stupid > mistakes while doing so. I looked over what you send, and the patches and the changes you made look good to me. > Junio C Hamano (1): > stash: fix nonsense pipeline > > Thomas Gummerer (2): > stash push: avoid printing errors > stash push -u: don't crea

Re: [RFC PATCH] git-submodule.sh:cmd_update: if submodule branch exists, fetch that instead of default

2018-03-16 Thread Thomas Gummerer
git shortlog', which make it harder than necessary for new contributors to pick out the appropriate list of people to cc on their patch series, mention the 'git contacts' utility, which should make it much easier to get a reasonable list of contacts for a change. Signed-off-by: Thomas Gummerer &

[PATCH v3 1/2] stash push: avoid printing errors

2018-03-16 Thread Thomas Gummerer
this by making sure to only call this command chain if there are still files that match after the call to 'git clean'. Reported-by: Marc Strapetz <marc.strap...@syntevo.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- git-stash.sh | 9 ++--- t/t3903-stash.sh | 16 +++

[PATCH v3 2/2] stash push -u: don't create empty stash

2018-03-16 Thread Thomas Gummerer
function. Reported-by: Marc Strapetz <marc.strap...@syntevo.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- git-stash.sh | 2 +- t/t3903-stash.sh | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/git-stash.sh b/git-stash.sh index 4de9f9bea8..dbed

[PATCH v3 0/2] stash push -u -- fixes

2018-03-16 Thread Thomas Gummerer
t;tracked && + git add tracked && + >untracked && + git stash push -u -- untracked && + test_path_is_missing untracked && + test_path_is_file tracked +' + test_expect_success 'stash -u -- shows no changes when there are none' '

Re: [PATCH v2 1/2] stash push: avoid printing errors

2018-03-16 Thread Thomas Gummerer
On 03/15, Marc Strapetz wrote: > On 14.03.2018 22:46, Thomas Gummerer wrote: > >Currently 'git stash push -u -- ' prints the following errors > >if only matches untracked files: > > > > fatal: pathspec 'untracked' did not match any files > &

Re: [PATCH v2 2/2] stash push -u: don't create empty stash

2018-03-16 Thread Thomas Gummerer
On 03/15, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > no_changes () { > > git diff-index --quiet --cached HEAD --ignore-submodules -- "$@" && > > git diff-files --quiet --ignore-submodules --

[PATCH v2 1/2] stash push: avoid printing errors

2018-03-14 Thread Thomas Gummerer
this by making sure to only call this command chain if there are still files that match after the call to 'git clean'. Reported-by: Marc Strapetz <marc.strap...@syntevo.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- > Either way I'll try to address this as soon as I can

[PATCH v2 2/2] stash push -u: don't create empty stash

2018-03-14 Thread Thomas Gummerer
function. Reported-by: Marc Strapetz <marc.strap...@syntevo.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- git-stash.sh | 2 +- t/t3903-stash.sh | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/git-stash.sh b/git-stash.sh index 058ad0bed8..7a4e

Re: git stash push -u always warns "pathspec '...' did not match any files"

2018-03-10 Thread Thomas Gummerer
On 03/10, Marc Strapetz wrote: > On 09.03.2018 23:18, Junio C Hamano wrote: > >Marc Strapetz writes: > > > >>Thanks, I can confirm that the misleading warning message is fixed. > >> > >>What I've noticed now is that when using -u option, Git won't warn if > >>the

Re: git stash push -u always warns "pathspec '...' did not match any files"

2018-03-03 Thread Thomas Gummerer
sure to only call this command chain if there are still files that match after the call to 'git clean'. Reported-by: Marc Strapetz <marc.strap...@syntevo.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- git-stash.sh | 2 +- t/t3903-stash.sh | 7 +++ 2 files changed,

Re: [PATCH v2 1/3] worktree: improve message when creating a new worktree

2018-02-09 Thread Thomas Gummerer
On 02/07, Eric Sunshine wrote: > On Sun, Feb 4, 2018 at 9:12 PM, Duy Nguyen wrote: > > As a former translator, I'm not thrilled to see a sentence broken into > > two pieces like this. I'm not a Japanese translator, but I think this > > sentence is translated differently when

Re: [PATCH v2 3/3] worktree: teach "add" to check out existing branches

2018-02-09 Thread Thomas Gummerer
On 02/06, Duy Nguyen wrote: > On Tue, Feb 6, 2018 at 3:23 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > On 02/05, Duy Nguyen wrote: > >> On Sun, Feb 04, 2018 at 10:13:05PM +, Thomas Gummerer wrote: > >> > - if (opts->new_branch) > &

Re: [PATCH v2 3/3] worktree: teach "add" to check out existing branches

2018-02-05 Thread Thomas Gummerer
On 02/05, Duy Nguyen wrote: > On Sun, Feb 04, 2018 at 10:13:05PM +0000, Thomas Gummerer wrote: > > - if (opts->new_branch) > > + if (opts->checkout_existing_branch) > > + fprintf(stderr, _(", checking out existing branch '%s'"), > > +

Re: [PATCH v2 1/3] worktree: improve message when creating a new worktree

2018-02-05 Thread Thomas Gummerer
On 02/05, Duy Nguyen wrote: > On Sun, Feb 04, 2018 at 10:13:03PM +0000, Thomas Gummerer wrote: > > diff --git a/builtin/worktree.c b/builtin/worktree.c > > index 7cef5b120b..d1549e441d 100644 > > --- a/builtin/worktree.c > > +++ b/builtin/worktree.c > > @@ -303,7

[PATCH v2 1/3] worktree: improve message when creating a new worktree

2018-02-04 Thread Thomas Gummerer
: Preparing foo (identifier foo) even though the HEAD is set to a commit, which is just not checked out. Fix these inconsistencies by making the 'git reset --hard' call quiet, and printing the message ourselves instead. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- We might want

[PATCH v2 2/3] worktree: be clearer when "add" dwim-ery kicks in

2018-02-04 Thread Thomas Gummerer
re it's nice to tell the user which kind of dwim-ery kicked in. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- builtin/worktree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/worktree.c b/builtin/worktree.c index d1549e441d..74a853c2a3 100644 --- a/builti

[PATCH v2 0/3] worktree: teach "add" to check out existing branches

2018-02-04 Thread Thomas Gummerer
de any new magic to guess the branchname, as was suggested, as that would be a bigger change in the behaviour of git worktree, and is not a particular itch I have right now, so I'd prefer to keep it separate. Thomas Gummerer (3): worktree: improve message when creating a new worktree worktree: be c

[PATCH v2 3/3] worktree: teach "add" to check out existing branches

2018-02-04 Thread Thomas Gummerer
compatibility worries here. We will still 'die()' if the branch is checked out in another worktree, unless the --force flag is passed. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- Documentation/git-worktree.txt | 9 +++-- builtin/worktree.c

[RFC/PATCH] reset --hard: make use of the pretty machinery

2018-02-01 Thread Thomas Gummerer
ce function such as 'pp_commit_easy' that would do this already. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- Sending this as RFC/PATCH, as I'm not 100% sure this change in behaviour is acceptable, and that I'm not missing some other edge case, but I noticed this while trying to fi

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-27 Thread Thomas Gummerer
On 01/21, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > On 01/19, Junio C Hamano wrote: > >> Thomas Gummerer <t.gumme...@gmail.com> writes: > >> > >> > read_cache_from() defaults to using the gitdir of the_r

Re: [PATCH] trace: measure where the time is spent in the index-heavy operations

2018-01-27 Thread Thomas Gummerer
On 01/27, Nguyễn Thái Ngọc Duy wrote: > All the known heavy code blocks are measured (except object database > access). This should help identify if an optimization is effective or > not. An unoptimized git-status would give something like below (92% of > time is accounted). > > Signed-off-by:

Re: [PATCH] worktree: teach "add" to check out existing branches

2018-01-22 Thread Thomas Gummerer
On 01/22, Duy Nguyen wrote: > On Sun, Jan 21, 2018 at 7:02 PM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > [...] > > + > > If `` is omitted and neither `-b` nor `-B` nor `--detach` used, > > -then, as a convenience, a new branch based at HEAD is created

[PATCH] worktree: teach "add" to check out existing branches

2018-01-21 Thread Thomas Gummerer
compatibility worries here. We will still 'die()' if the branch is checked out in another worktree, unless the --force flag is passed. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- This is a follow-up to https://public-inbox.org/git/20171118181345.GC32324@hank/, where this was first sug

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-20 Thread Thomas Gummerer
On 01/19, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > read_cache_from() defaults to using the gitdir of the_repository. As it > > is mostly a convenience macro, having to pass get_git_dir() for every > > call seems overkill, and if

Re: [PATCH v3 0/3] fixes for split index mode

2018-01-19 Thread Thomas Gummerer
On 01/19, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > Friendly ping on this series now that 2.16 is out :) Is there anything > > in this series (up to 3/3, 4/3 can be dropped now that Duy fixed it in > > a nicer way) that still needs

Re: [PATCH v3 0/3] fixes for split index mode

2018-01-18 Thread Thomas Gummerer
. On 01/07, Thomas Gummerer wrote: > Thanks Brandon and Lars for comments on the previous round. > > Previous rounds were at <20171210212202.28231-1-t.gumme...@gmail.com> > and <20171217225122.28941-1-t.gumme...@gmail.com>. > > Changes since the previous roun

Re: [PATCH] Removed unnecessary void* from hashmap.h that caused compile warnings

2018-01-15 Thread Thomas Gummerer
On 01/15, Randall S. Becker wrote: > On January 15, 2018 3:43 PM, Thomas Gummerer wrote: > > Thanks for your patch! A few nitpicks below: > > > > > Subject: [PATCH] Removed unnecessary void* from hashmap.h that caused > > > compile warnings > > &

Re: [PATCH] Removed unnecessary void* from hashmap.h that caused compile warnings

2018-01-15 Thread Thomas Gummerer
Thanks for your patch! A few nitpicks below: > Subject: [PATCH] Removed unnecessary void* from hashmap.h that caused compile > warnings >From Documentation/SubmittingPatches: Describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[This patch] makes xyzzy do

Re: [PATCH v3 4/3] read-cache: don't try to write index if we can't write shared index

2018-01-14 Thread Thomas Gummerer
On 01/14, Duy Nguyen wrote: > On Sun, Jan 14, 2018 at 5:37 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > In a0a967568e ("update-index --split-index: do not split if $GIT_DIR is > > read only", 2014-06-13), we tried to make sure we can still write an > >

[PATCH v3 4/3] read-cache: don't try to write index if we can't write shared index

2018-01-13 Thread Thomas Gummerer
have users fix their repositories instead of trying (but failing) to paper over the error. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- read-cache.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/read-cache.c b/read-cache.c index d13ce83794..a

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-13 Thread Thomas Gummerer
On 01/08, Thomas Gummerer wrote: > On 01/08, Duy Nguyen wrote: > > On Mon, Jan 8, 2018 at 5:30 AM, Thomas Gummerer <t.gumme...@gmail.com> > > wrote: > > > @@ -1896,16 +1895,17 @@ int read_index_from(struct index_state *istate, > > > const char *path)

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-08 Thread Thomas Gummerer
On 01/08, Duy Nguyen wrote: > On Mon, Jan 8, 2018 at 5:30 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > @@ -1896,16 +1895,17 @@ int read_index_from(struct index_state *istate, > > const char *path) > > split_index->base = xcallo

[PATCH] oidset: don't return value from oidset_init

2018-01-07 Thread Thomas Gummerer
As the return type is void, and even the return type of the expression we're trying to return (oidmap_init) is void just remove the return statement to fix the compiler error. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- oidset.h | 2 +- 1 file changed, 1 insertion(+),

[PATCH v3 0/3] fixes for split index mode

2018-01-07 Thread Thomas Gummerer
o test. If this makes the life harder for anyone reviewing this let me know and I can base it on the same commit previous iterations were based on. Thomas Gummerer (3): read-cache: fix reading the shared index for other repos split-index: don't write cache tree with null sha1 entri

[PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-07 Thread Thomas Gummerer
ore control by using read_index_from(). Helped-by: Brandon Williams <bmw...@google.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- cache-tree.c | 2 +- cache.h | 5 +++-- read-cache.c | 23 +-- repository.c | 2 +- revision.c | 3 ++- 5 files changed

[PATCH v3 3/3] travis: run tests with GIT_TEST_SPLIT_INDEX

2018-01-07 Thread Thomas Gummerer
pobox.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- ci/run-tests.sh | 4 1 file changed, 4 insertions(+) diff --git a/ci/run-tests.sh b/ci/run-tests.sh index f0c743de94..c7aee5b9ff 100755 --- a/ci/run-tests.sh +++ b/ci/run-tests.sh @@ -8,3 +8,7 @@ mkdir -p $HOME/travis-

[PATCH v3 2/3] split-index: don't write cache tree with null oid entries

2018-01-07 Thread Thomas Gummerer
Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- cache.h| 3 ++- read-cache.c | 2 +- split-index.c | 2 ++ t/t1700-split-index.sh | 19 +++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/cache.h b/cache.h

Re: [PATCH v2 3/3] travis: run tests with GIT_TEST_SPLIT_INDEX

2018-01-07 Thread Thomas Gummerer
On 01/04, Thomas Gummerer wrote: > On 12/18, Lars Schneider wrote: > > [snip] > > For now I think that looks good. Maybe we could define additional test > > configurations with an environment variable. That could be an array variable > > defined in the lib-travis.ci

[PATCH v2] stash: don't delete untracked files that match pathspec

2018-01-05 Thread Thomas Gummerer
gmail.com> Helped-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- > Thanks, I'll fill in the gaps, and send a new patch, hopefully over > the weekend. Here it is :) Changes since the previous version: - handle binary files c

Re: [PATCH v5 13/34] directory rename detection: tests for handling overwriting untracked files

2018-01-05 Thread Thomas Gummerer
On 01/04, Elijah Newren wrote: > On Wed, Jan 3, 2018 at 5:52 PM, SZEDER Gábor wrote: > > >> + test $(git rev-parse :0:y/b) = $(git rev-parse O:z/b) && > > > > There is a test helper for that :) > > > > test_cmp_rev :0:y/b O:z/b > > > > Note, that this is not

Re: Apparent bug in 'git stash push ' loses untracked files

2018-01-05 Thread Thomas Gummerer
On 12/18, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > Ah interesting, what you have below looks good to me indeed, it > > matches what I'd expect it to do and fixes the bug that was reported. > > Thanks! > > > > I've tak

Re: [ANNOUNCE] Git v2.16.0-rc0

2018-01-04 Thread Thomas Gummerer
On 12/29, Paul Smith wrote: > On Thu, 2017-12-28 at 20:30 -0800, Junio C Hamano wrote: > > * The way "git worktree add" determines what branch to create from > >where and checkout in the new worktree has been updated a bit. > > Does this include the enhancements published a few weeks ago to

Re: [PATCH v2 3/3] travis: run tests with GIT_TEST_SPLIT_INDEX

2018-01-04 Thread Thomas Gummerer
On 12/18, Lars Schneider wrote: > > > On 17 Dec 2017, at 23:51, Thomas Gummerer <t.gumme...@gmail.com> wrote: > > > > Split index mode only has a few dedicated tests, but as the index is > > involved in nearly every git operation, this doesn't quite cover all the

Re: [PATCH v2 2/3] prune: fix pruning with multiple worktrees and split index

2018-01-03 Thread Thomas Gummerer
[sorry for the late reply. I was on Christmas holidays until today and am still catching up on the mailing list. It will probably take me untill the weekend to send a re-roll] On 12/18, Brandon Williams wrote: > On 12/17, Thomas Gummerer wrote: > > be489d02d2 ("revision.c: --index

Re: [PATCH v2 1/3] repository: fix repo_read_index with submodules

2017-12-18 Thread Thomas Gummerer
On 12/18, Brandon Williams wrote: > On 12/17, Thomas Gummerer wrote: > > repo_read_index calls read_index_from, which takes an path argument for > > the location of the index file. For the split index however it relies > > > on the current working directory to construct

[PATCH v2 1/3] repository: fix repo_read_index with submodules

2017-12-17 Thread Thomas Gummerer
tive would have been to make the callers pass in the base path for the split index, however that ended up being more complicated, and I think we want to converge towards using struct repository for things like these anyway. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- cache.h

[PATCH v2 3/3] travis: run tests with GIT_TEST_SPLIT_INDEX

2017-12-17 Thread Thomas Gummerer
unio C Hamano <gits...@pobox.com> Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- ci/run-linux32-build.sh | 1 + ci/run-tests.sh | 4 2 files changed, 5 insertions(+) diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh index e30fb2cddc..f173c9cf2a 100755 --

[PATCH v2 0/3] fixes for split index mode

2017-12-17 Thread Thomas Gummerer
n.c index 9d8d9b96d1..34e1e4b799 100644 --- a/revision.c +++ b/revision.c @@ -1358,6 +1358,7 @@ void add_index_objects_to_pending(struct rev_info *revs, unsigned int flags) if (repo_read_index(repo) > 0) do_add_index_objects_to_pending(revs, repo->

[PATCH v2 2/3] prune: fix pruning with multiple worktrees and split index

2017-12-17 Thread Thomas Gummerer
the proper paths for the worktree. This fixes t5304-prune when ran with GIT_TEST_SPLIT_INDEX set. Signed-off-by: Thomas Gummerer <t.gumme...@gmail.com> --- repository.c | 11 +++ repository.h | 2 ++ revision.c | 14 +- 3 files changed, 22 insertions(+), 5 deletion

Re: Apparent bug in 'git stash push ' loses untracked files

2017-12-17 Thread Thomas Gummerer
On 12/16, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > Maybe the best solution would be to introduce 'git reset --hard -- > > ', or maybe someone who knows shell programming a little > > better than me has an idea? > > > >

Re: [PATCH 3/3] travis: run tests with GIT_TEST_SPLIT_INDEX

2017-12-13 Thread Thomas Gummerer
On 12/13, Lars Schneider wrote: > > > On 13 Dec 2017, at 18:38, Junio C Hamano wrote: > > > > Lars Schneider writes: > > > >> I think your solution points into the right direction. > >> Right now we have the following test matrix: > >> > >> 1.

Re: [PATCH 3/3] travis: run tests with GIT_TEST_SPLIT_INDEX

2017-12-13 Thread Thomas Gummerer
On 12/12, Junio C Hamano wrote: > Thomas Gummerer <t.gumme...@gmail.com> writes: > > > > > The breakages wen the split-index code fails tend to break things in > > much more obvious manners than a wrong message, usually git ends up > > dying if it gets broke

<    1   2   3   4   5   6   7   8   9   >