Re: [PATCH v5 3/5] rebase: fast-forward --onto in more cases

2019-04-16 Thread Denton Liu
On Tue, Apr 16, 2019 at 02:59:12PM +0100, Phillip Wood wrote: > Hi Denton > > It's good to see rebase fast-forwarding properly when it should > > On 15/04/2019 23:29, Denton Liu wrote: > > Before, when we had the following graph, > > > > A---B---C (master) > > \ > > D (side)

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Junio C Hamano
Taylor Blau writes: >> That's this one >> >> Date: Tue, 9 Apr 2019 19:13:06 -0700 (1 week, 3 hours, 23 minutes ago) >> Subject: [PATCH v2 0/7] harden unexpected object types checks >> >> which I think is what has been queued and what is listed in the >> message you are responding to. > >

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Taylor Blau
On Wed, Apr 17, 2019 at 02:38:34PM +0900, Junio C Hamano wrote: > Taylor Blau writes: > > > Hi Junio, > > > > On Tue, Apr 16, 2019 at 10:19:45PM +0900, Junio C Hamano wrote: > >> * tb/unexpected (2019-04-10) 7 commits > >> ... > >> Code tightening against a "wrong" object appearing where an objec

Re: [PATCH 7/7] Turn `git serve` into a test helper

2019-04-16 Thread Junio C Hamano
Jeff King writes: >> I do not personally think, as the design of v2 stands, a standalone >> "serve" server that "can serve anything as long as it goes over >> protocol v2" makes much sense, but perhaps those who have been doing >> the v2 work may have different ideas, in which case let's hear wha

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Junio C Hamano
Taylor Blau writes: > Hi Junio, > > On Tue, Apr 16, 2019 at 10:19:45PM +0900, Junio C Hamano wrote: >> * tb/unexpected (2019-04-10) 7 commits >> ... >> Code tightening against a "wrong" object appearing where an object >> of a different type is expected, instead of blindly assuming that >> the

Re: [PATCH v2 1/1] documentation: add lab for first contribution

2019-04-16 Thread Junio C Hamano
"Emily Shaffer via GitGitGadget" writes: > Subject: Re: [PATCH v2 1/1] documentation: add lab for first contribution > From: Emily Shaffer > > This code lab covers how to add a new command to Git and, in the > process, everything from cloning git/git to getting reviewed on the mail "lab"? I th

[PATCH] Give git-pull a --reset option

2019-04-16 Thread Alex Henrie
A common workflow is to make a commit on a local branch, push the branch to the remote, check out the remote branch on a second computer, amend the commit on the second computer, force-push back to the remote branch, and finally submit a pull request. However, if the user switches back to the first

Re: [PATCH 7/7] Turn `git serve` into a test helper

2019-04-16 Thread Jeff King
On Mon, Apr 15, 2019 at 11:03:02PM +0900, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" > writes: > > > From: Johannes Schindelin > > > > The `git serve` built-in was introduced in ed10cb952d31 (serve: > > introduce git-serve, 2018-03-15) as a backend to serve Git protocol v2,

Re: jt/clone-server-option (was What's cooking in git.git (Apr 2019, #03; Tue, 16))

2019-04-16 Thread Junio C Hamano
Jonathan Tan writes: >> * jt/clone-server-option (2019-04-15) 4 commits >> - SQUASH??? >> - clone: send server options when using protocol v2 >> - SQUASH??? >> - transport: die if server options are unsupported >> >> "git clone" learned a new --server-option option when talking over >> the

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Junio C Hamano
Ben Peart writes: >> * bp/post-index-change-hook (2019-02-15) 1 commit >>(merged to 'next' on 2019-03-11 at cb96d1d7c4) >> + read-cache: add post-index-change hook >> >> Originally merged to 'next' on 2019-02-23 >> >> A new hook "post-index-change" is called when the on-disk index >>

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Taylor Blau
Hi Junio, On Tue, Apr 16, 2019 at 10:19:45PM +0900, Junio C Hamano wrote: > * tb/unexpected (2019-04-10) 7 commits > - rev-list: detect broken root trees > - rev-list: let traversal die when --missing is not in use > - get_commit_tree(): return NULL for broken tree > - list-objects.c: handle u

Re: [BUG] git stash --keep-index undeletes file

2019-04-16 Thread Thomas Gummerer
[please don't top post on this list] On 04/16, Christian Vetter wrote: > Thank you, Thomas! > > Now that you explained this, I do understand the behaviour, and agree that it > is correct. > While this seems to be clear with a deeper understanding of git than I have, > it might be a good idea to

Re: [PATCH 1/1] Fix %(push:track) in ref-filter

2019-04-16 Thread Jeff King
On Tue, Apr 16, 2019 at 02:39:45PM +0200, Damien Robert wrote: > > Or perhaps it argues for just giving access to the more generic stat_* > > function, and letting callers pass in a flag for push vs upstream (and > > either leaving stat_tracking_info() as a wrapper, or just updating its > > few ca

Re: [PATCH v2 0/1] documentation: add lab for first contribution

2019-04-16 Thread Emily Shaffer
On Tue, Apr 16, 2019 at 1:26 PM Emily Shaffer via GitGitGadget wrote: > > RFC. I am still working on adding a section on handling refs and objects. Sorry for the spam; above line was stale in GitGitGadget. The relevant section has been added just before the help page. I think the change is comple

[PATCH v2 1/1] documentation: add lab for first contribution

2019-04-16 Thread Emily Shaffer via GitGitGadget
From: Emily Shaffer This code lab covers how to add a new command to Git and, in the process, everything from cloning git/git to getting reviewed on the mail list. It's meant for new contributors to go through interactively, learning the techniques generally used by the git/git development commun

[PATCH v2 0/1] documentation: add lab for first contribution

2019-04-16 Thread Emily Shaffer via GitGitGadget
RFC. I am still working on adding a section on handling refs and objects. A tutorial for beginners explaining how to commit to git/git from clone to push. This tutorial attempts to explain the GitGitGadget workflow; with the review I'm hoping to understand whether it's worth the effort to detail h

Re: [BUG] git stash --keep-index undeletes file

2019-04-16 Thread Christian Vetter
Thank you, Thomas! Now that you explained this, I do understand the behaviour, and agree that it is correct. While this seems to be clear with a deeper understanding of git than I have, it might be a good idea to specifically point this out in the docs in the context of `--keep-index`. That woul

Re: [BUG] git stash --keep-index undeletes file

2019-04-16 Thread Thomas Gummerer
On 04/16, Christian Vetter wrote: > Steps to reproduce > + mkdir git-stash-test > + cd git-stash-test > + git init > + touch file > + git add file > + git commit -m init > + git rm file > + git stash push --keep-index > > > Result: > `git status` gives this output: > > On branch master > > Cha

[BUG] git stash --keep-index undeletes file

2019-04-16 Thread Christian Vetter
Steps to reproduce + mkdir git-stash-test + cd git-stash-test + git init + touch file + git add file + git commit -m init + git rm file + git stash push --keep-index Result: `git status` gives this output: > On branch master > Changes to be committed: > (use "git reset HEAD ..." to unstage)

jt/clone-server-option (was What's cooking in git.git (Apr 2019, #03; Tue, 16))

2019-04-16 Thread Jonathan Tan
> * jt/clone-server-option (2019-04-15) 4 commits > - SQUASH??? > - clone: send server options when using protocol v2 > - SQUASH??? > - transport: die if server options are unsupported > > "git clone" learned a new --server-option option when talking over > the protocol version 2. > > Getti

Re: feature request: .blameignore

2019-04-16 Thread Christian González
> I think there's a slight misunderstanding.  In the patchset that > Michael and I are working on, the user specifies whole commits > explicitly.  This is usually done with a file, but can also be done > from the command line for "one-off" ignored commits.  That sounds like > what you want. > > Th

Stalled ds/ branches (was What's cooking in git.git (Apr 2019, #03; Tue, 16))

2019-04-16 Thread Derrick Stolee
On 4/16/2019 9:19 AM, Junio C Hamano wrote: > * ds/midx-expire-repack (2019-01-27) 10 commits > - midx: add test that 'expire' respects .keep files > - multi-pack-index: test expire while adding packs > - midx: implement midx_repack() > - multi-pack-index: prepare 'repack' subcommand > - mult

Generating a todo file for non-interactive rebasing

2019-04-16 Thread Drew DeVault
Hiya! Whenever I do a particularly long rebase on a branch, sorting out conflicts from upstream, I find that it's often useful to have the additional context that you get during an interactive rebase, such as recent commands run, commands planned to run, and so on, to get a better idea of where I'

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Ben Peart
On 4/16/2019 9:19 AM, Junio C Hamano wrote: Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holdi

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > On Tue, Apr 16 2019, Junio C Hamano wrote: > > >> * jc/gettext-test-fix (2019-04-15) 1 commit >> - gettext tests: export the restored GIT_TEST_GETTEXT_POISON >> >> The GETTEXT_POISON test option has been quite broken ever since it >> was made runtime-tunable,

Re: feature request: .blameignore

2019-04-16 Thread Barret Rhoden
Hi - On 4/15/19 5:56 PM, Christian González wrote: Am 15.04.19 um 23:15 schrieb Thomas Gummerer: This sounds roughly like what Barret Rhoden (added to Cc) has been working on. I haven't followed that patch series in detail, but you can have a look at it atthe latest iteration at https://public

Re: What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Ævar Arnfjörð Bjarmason
On Tue, Apr 16 2019, Junio C Hamano wrote: > * jc/gettext-test-fix (2019-04-15) 1 commit > - gettext tests: export the restored GIT_TEST_GETTEXT_POISON > > The GETTEXT_POISON test option has been quite broken ever since it > was made runtime-tunable, which has been fixed. > > Will merge to

Re: [PATCH 07/14] parse-options: allow ll_callback with OPTION_CALLBACK

2019-04-16 Thread Derrick Stolee
On 4/16/2019 4:52 AM, Duy Nguyen wrote: > On Mon, Apr 15, 2019 at 9:06 PM Derrick Stolee wrote: >> >> On 1/26/2019 7:35 PM, Nguyễn Thái Ngọc Duy wrote: >>> @@ -238,7 +249,10 @@ static enum parse_opt_result parse_short_opt(struct >>> parse_opt_ctx_t *p, >>> len++; >>>

Re: [PATCH 1/1] Fix %(push:track) in ref-filter

2019-04-16 Thread Christian Couder
On Tue, Apr 16, 2019 at 2:42 PM Damien Robert wrote: > You are welcome. What's the standard way to acknowledge your help in > the Foo-By: trailers? I did not put a Reviewed-By: because you reviewed the > previous patch, not the current one :) We often use: Helped-by: Jeff King

Re: [PATCH v5 3/5] rebase: fast-forward --onto in more cases

2019-04-16 Thread Phillip Wood
Hi Denton It's good to see rebase fast-forwarding properly when it should On 15/04/2019 23:29, Denton Liu wrote: Before, when we had the following graph, A---B---C (master) \ D (side) running 'git rebase --onto master... master side' would result in D being al

What's cooking in git.git (Apr 2019, #03; Tue, 16)

2019-04-16 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. Yet another batch of ~30 topics ha

Re: [PATCH 1/1] Fix %(push:track) in ref-filter

2019-04-16 Thread Damien Robert
>From Jeff King, Mon 15 Apr 2019 at 18:01:08 (-0400) : > > + if ((atom->u.remote_ref.push ? > > +stat_push_info(branch, &num_ours, &num_theirs, > > + NULL, AHEAD_BEHIND_FULL) : > > +stat_tracking_info(branch, &num_ours, &num_th

[PATCH v2 0/2] A couple of cherry-pick related fixes

2019-04-16 Thread Phillip Wood
From: Phillip Wood I've updated the first patch as per Junio's suggestions and added tests for revert as well as cherry-pick. I've also changed the second patch to avoid printing the oid of the origin of the commit that's just been created and added tests for revert as well as cherry-pick. In the

[PATCH v2 1/2] commit/reset: try to clean up sequencer state

2019-04-16 Thread Phillip Wood
From: Phillip Wood When cherry-picking or reverting a sequence of commits and if the final pick/revert has conflicts and the user uses `git commit` to commit the conflict resolution and does not run `git cherry-pick --continue` then the sequencer state is left behind. This can cause problems late

[PATCH v2 2/2] fix cherry-pick/revert status after commit

2019-04-16 Thread Phillip Wood
From: Phillip Wood If the user commits a conflict resolution using `git commit` in the middle of a sequence of cherry-picks/reverts then `git status` missed the fact that a cherry-pick/revert is still in progress. Signed-off-by: Phillip Wood --- sequencer.c| 35

[PATCH v4 34/34] sha1-name.c: remove the_repo from get_oid_mb()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 ++- sha1-name.c | 18 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cache.h b/cache.h index 871a167bf8..9a600a8b50 100644 --- a/cache.h +++ b/cache.h @@ -1386,6 +1386,7 @@ int repo_get_oid_committish(st

[PATCH v4 31/34] submodule-config.c: use repo_get_oid for reading .gitmodules

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Since 76e9bdc437 (submodule: support reading .gitmodules when it's not in the working tree - 2018-10-25), every time you do git grep --recurse-submodules you are likely to see one warning line per submodule (unless all those submodules also have submodules). On a superproject with plenty of s

[PATCH v4 32/34] sha1-name.c: remove the_repo from maybe_die_on_misspelt_object_name

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 4 +++- setup.c | 7 --- sha1-name.c | 6 -- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cache.h b/cache.h index f6e87194d0..3718b3db8a 100644 --- a/cache.h +++ b/cache.h @@ -1387,7 +1387,9 @@ extern int get_oid

[PATCH v4 33/34] sha1-name.c: remove the_repo from other get_oid_*

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 18 -- sha1-name.c | 35 --- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/cache.h b/cache.h index 3718b3db8a..871a167bf8 100644 --- a/cache.h +++ b/cache.h @@ -1381,12 +1381,1

[PATCH v4 30/34] sha1-name.c: add repo_get_oid()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 ++- sha1-name.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index 2149dc4f56..f6e87194d0 100644 --- a/cache.h +++ b/cache.h @@ -1380,7 +1380,8 @@ enum get_oid_result { */

[PATCH v4 28/34] sha1-name.c: remove the_repo from resolve_relative_path()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
"remove" is not entirely correct. But at least the function is aware that if the given repo is not the_repository, then $CWD and is_inside_work_tree() means nothing. Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sh

[PATCH v4 29/34] sha1-name.c: remove the_repo from get_oid_with_context_1()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sha1-name.c b/sha1-name.c index 6b53ea2eeb..64a50d1291 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -12,6 +12,7 @@ #include "packfile.h" #include "object-store.h"

[PATCH v4 23/34] sha1-name.c: remove the_repo from get_describe_name()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index fb80306f1a..1cda854f02 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -1097,7 +1097,9 @@ static int peel_onion(const char *name, int len,

[PATCH v4 27/34] sha1-name.c: remove the_repo from diagnose_invalid_index_path()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 8 dir.h | 4 +++- sha1-name.c | 7 --- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dir.c b/dir.c index b2cabadf25..e6d97343f4 100644 --- a/dir.c +++ b/dir.c @@ -2315,6 +2315,14 @@ int file_exists(const c

[PATCH v4 25/34] sha1-name.c: remove the_repo from get_oid_1()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
There is a cyclic dependency between one of these functions so they cannot be converted one by one, so all related functions are converted at once. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 7 +-- sha1-name.c | 59 - 2 files ch

[PATCH v4 26/34] sha1-name.c: remove the_repo from handle_one_ref()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 5741a9f821..d9050776dd 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -1189,15 +1189,21 @@ static enum get_oid_result get_oid

[PATCH v4 22/34] sha1-name.c: remove the_repo from get_oid_oneline()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 49c62d5254..fb80306f1a 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -15,7 +15,7 @@ #include "midx.h" #include "commit-reach.h"

[PATCH v4 19/34] sha1-name.c: remove the_repo from interpret_nth_prior_checkout()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 2643b75b54..af8bf5b351 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -771,7 +771,7 @@ static inline int push_mark(const char *

[PATCH v4 20/34] sha1-name.c: remove the_repo from interpret_branch_mark()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index af8bf5b351..7d9512ac44 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -1412,9 +1412,9 @@ static int reinterpret(const char *name, in

[PATCH v4 24/34] sha1-name.c: remove the_repo from get_oid_basic()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 1cda854f02..d4c135aea8 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -773,8 +773,8 @@ static inline int push_mark(con

[PATCH v4 21/34] sha1-name.c: add repo_interpret_branch_name()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 7d9512ac44..49c62d5254 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -1390,7 +1390,8 @@ static int interpret_empty_at(const cha

[PATCH v4 15/34] sha1-name.c: add repo_find_unique_abbrev_r()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 6 -- sha1-name.c | 15 +-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cache.h b/cache.h index fcb24b5781..4f8ebb0a67 100644 --- a/cache.h +++ b/cache.h @@ -1045,8 +1045,10 @@ extern void check_repository_

[PATCH v4 16/34] sha1-name.c: store and use repo in struct disambiguate_state

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 95 + 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 9b57787b76..a75992eb54 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -17,13 +17,14 @@

[PATCH v4 14/34] sha1-name.c: remove the_repo from find_abbrev_len_packed()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 7558ce51a3..b9381aaba6 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -514,6 +514,7 @@ struct min_abbrev_data { unsigned int init_le

[PATCH v4 18/34] sha1-name.c: remove the_repo from get_short_oid()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index cdcf84b826..2643b75b54 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -436,7 +436,8 @@ static void sort_ambiguous_oid_array(str

[PATCH v4 17/34] sha1-name.c: add repo_for_each_abbrev()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 ++- sha1-name.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index 4f8ebb0a67..0cb95c0d4f 100644 --- a/cache.h +++ b/cache.h @@ -1392,7 +1392,8 @@ extern enum get_oid_result get_oid_with_contex

[PATCH v4 11/34] commit.cocci: refactor code, avoid double rewrite

2019-04-16 Thread Nguyễn Thái Ngọc Duy
"maybe" pointer in 'struct commit' is tricky because it can be lazily initialized to take advantage of commit-graph if available. This makes it not safe to access directly. This leads to a rule in commit.cocci to rewrite 'x->maybe_tree' to 'get_commit_tree(x)'. But that rule alone could lead to in

[PATCH v4 06/34] refs.c: remove the_repo from substitute_branch_name()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 8 ++-- refs.c | 9 + sha1-name.c | 8 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cache.h b/cache.h index ac92421f3a..fcb24b5781 100644 --- a/cache.h +++ b/cache.h @@ -1468,8 +1468,12 @@ extern in

[PATCH v4 13/34] sha1-name.c: remove the_repo from sort_ambiguous()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1-name.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sha1-name.c b/sha1-name.c index 15a1107998..7558ce51a3 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -383,10 +383,11 @@ static int collect_ambiguous(const struc

[PATCH v4 12/34] commit.c: add repo_get_commit_tree()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Remove the implicit dependency on the_repository in this function. It will be used in sha1-name.c functions when they are updated to take any 'struct repository'. get_commit_tree() remains as a compat wrapper, to be slowly replaced later. Any access to "maybe_tree" field directly will result in _b

[PATCH v4 10/34] refs.c: remove the_repo from read_ref_at()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/show-branch.c | 6 -- refs.c| 7 --- refs.h| 3 ++- sha1-name.c | 3 ++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/builtin/show-branch.c b/builtin/show-branch.c index 934e514944

[PATCH v4 05/34] refs.c: add refs_shorten_unambiguous_ref()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 11 +-- refs.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index b869f32d8b..3dde824aab 100644 --- a/refs.c +++ b/refs.c @@ -1169,7 +1169,8 @@ int update_ref(const char *msg, const char *refname,

[PATCH v4 07/34] refs.c: remove the_repo from expand_ref()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c| 10 ++ refs.h| 2 +- upload-pack.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index 44df049796..1f5864aa36 100644 --- a/refs.c +++ b/refs.c @@ -558,12 +558,13 @@ static char *subs

[PATCH v4 09/34] refs.c: add repo_dwim_log()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 21 +++-- refs.h | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index bd0fec5776..edea001446 100644 --- a/refs.c +++ b/refs.c @@ -603,9 +603,11 @@ int expand_ref(struct repository *repo, cons

[PATCH v4 08/34] refs.c: add repo_dwim_ref()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 12 +--- refs.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/refs.c b/refs.c index 1f5864aa36..bd0fec5776 100644 --- a/refs.c +++ b/refs.c @@ -555,14 +555,20 @@ static char *substitute_branch_name(struct repositor

[PATCH v4 03/34] packfile.c: add repo_approximate_object_count()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- packfile.c | 14 +++--- packfile.h | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packfile.c b/packfile.c index 16bcb75262..2ad4fab2f8 100644 --- a/packfile.c +++ b/packfile.c @@ -893,25 +893,25 @@ static void prepare_packe

[PATCH v4 04/34] refs.c: add refs_ref_exists()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 142888a40a..b869f32d8b 100644 --- a/refs.c +++ b/refs.c @@ -241,9 +241,14 @@ int read_ref(const char *refname, struct object_id *oid) return read_

[PATCH v4 01/34] builtin rebase: use FREE_AND_NULL

2019-04-16 Thread Nguyễn Thái Ngọc Duy
From: SZEDER Gábor Use the macro FREE_AND_NULL to release memory allocated for 'head_name' and clear its pointer. Patch generated with 'contrib/coccinelle/free.cocci' and Coccinelle v1.0.7 (previous Coccinelle versions don't notice this). Signed-off-by: SZEDER Gábor Signed-off-by: Nguyễn Thái

[PATCH v4 02/34] builtin rebase: use oideq()

2019-04-16 Thread Nguyễn Thái Ngọc Duy
From: SZEDER Gábor Use oideq() instead of !oidcmp(), as it is more idiomatic, and might give the compiler more opportunities to optimize. Patch generated with 'contrib/coccinelle/free.cocci' and Coccinelle v1.0.7 (previous Coccinelle versions don't notice this). Signed-off-by: SZEDER Gábor Sig

[PATCH v4 00/34] nd/sha1-name-c-wo-the-repository updates

2019-04-16 Thread Nguyễn Thái Ngọc Duy
v4 is all about updating commit.c and commit.cocci 11/33. I think I have incorporated all changes from v3 discussion. The changes are separated to a new patch 11/34 though, the old 11/33 is now 12/34. Diff diff --git a/commit-graph.c b/commit-graph.c index 47e9be0a3a..155a270457 100644 --- a/comm

Re: [PATCH 07/14] parse-options: allow ll_callback with OPTION_CALLBACK

2019-04-16 Thread Duy Nguyen
On Mon, Apr 15, 2019 at 9:06 PM Derrick Stolee wrote: > > On 1/26/2019 7:35 PM, Nguyễn Thái Ngọc Duy wrote: > > @@ -238,7 +249,10 @@ static enum parse_opt_result parse_short_opt(struct > > parse_opt_ctx_t *p, > > len++; > > arg = xmemdupz(p->opt, len); > >

Re: regression AGAIN in output of git-pull --rebase --recurse-submodules=yes --quiet

2019-04-16 Thread Duy Nguyen
On Tue, Apr 16, 2019 at 1:31 PM Paul Morelle wrote: >> The problem here is the option parser of this command would try to >> parse all options, so it considers both --quiet the same thing and are >> to tell "submodule--foreach" to be quiet, the second --quiet is not >> part of the "git pull" comma