[PATCH 3/3] t0030: reformat style

2018-09-21 Thread Stefan Beller
Signed-off-by: Stefan Beller --- t/t0030-stripspace.sh | 525 -- 1 file changed, 254 insertions(+), 271 deletions(-) diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh index 5ce47e8af51..c2281a39b58 100755 --- a/t/t0030-stripspace.sh +++

[PATCH 2/3] t7004: reformat style

2018-09-21 Thread Stefan Beller
Signed-off-by: Stefan Beller --- t/t7004-tag.sh | 149 +++-- 1 file changed, 56 insertions(+), 93 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 0b01862c23a..03a96b7f79e 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -144,26

[PATCH 0/3] bring some tests to newer style.

2018-09-21 Thread Stefan Beller
The old formatting style is a real hindrance of getting people up to speed contributing as they use existing code as an example and follow that style. So let's get rid of the old style and reformat it in our current style. This was reported off list by Derrick and Jeff as both of them followed

[PATCH 1/3] t7001: reformat to newer style

2018-09-21 Thread Stefan Beller
The old formatting style is a real hindrance of getting people up to speed contributing as they use existing code as an example and follow that style. So let's get rid of the old style and reformat it in our current style. Reported-by: Derrick Stolee Reported-by: Jeff Hostetler Signed-off-by:

Re: [PATCH v3 2/2] commit-reach: fix memory and flag leaks

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 08:05:27AM -0700, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee > > The can_all_from_reach_with_flag() method uses 'assign_flag' as a > value we can use to mark objects temporarily during our commit walk. > The intent is that these flags are removed from

Re: [PATCH v3 1/2] commit-reach: properly peel tags

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 08:05:26AM -0700, Derrick Stolee via GitGitGadget wrote: > diff --git a/commit-reach.c b/commit-reach.c > index 86715c103c..e748414d04 100644 > --- a/commit-reach.c > +++ b/commit-reach.c > @@ -544,20 +544,42 @@ int can_all_from_reach_with_flag(struct object_array >

Re: Segfault in master due to 4fbcca4eff

2018-09-21 Thread Ævar Arnfjörð Bjarmason
On Fri, Sep 21 2018, Jeff King wrote: > On Sat, Sep 22, 2018 at 01:37:17AM +0200, Ævar Arnfjörð Bjarmason wrote: > >> > Thanks, both of you ;-). I was aware of the issue and proposed fix >> > but forgot about it when merging things down to 'master'. Sorry >> > about that. >> >> Just a

Re: Segfault in master due to 4fbcca4eff

2018-09-21 Thread Jeff King
On Sat, Sep 22, 2018 at 01:37:17AM +0200, Ævar Arnfjörð Bjarmason wrote: > > Thanks, both of you ;-). I was aware of the issue and proposed fix > > but forgot about it when merging things down to 'master'. Sorry > > about that. > > Just a follow-up question, in your merge commit you just

Re: Very simple popen() code request, ground-shaking functionality openned by it

2018-09-21 Thread Jeff King
On Sat, Sep 22, 2018 at 01:30:36AM +0200, Ævar Arnfjörð Bjarmason wrote: > >> This will allow users to free their creativity and provide probably > >> dozens of custom Git progress bars. > > > > I don't personally feel that the existing progress bar is that bad, but > > if anybody wants to pursue

Re: Segfault in master due to 4fbcca4eff

2018-09-21 Thread Ævar Arnfjörð Bjarmason
On Fri, Sep 21 2018, Junio C Hamano wrote: > Derrick Stolee writes: > >> On 9/21/2018 10:40 AM, Ævar Arnfjörð Bjarmason wrote: >>> On Fri, Sep 21 2018, Derrick Stolee wrote: >>> This error was reported by Peff [1] and fixed in [2], but as stated [3] I was waiting for more review

Re: Very simple popen() code request, ground-shaking functionality openned by it

2018-09-21 Thread Ævar Arnfjörð Bjarmason
On Fri, Sep 21 2018, Jeff King wrote: > On Fri, Sep 21, 2018 at 09:34:14AM -0400, Sebastian Gniazdowski wrote: > >> Git default progress indicator for clone is very unattractive, IMO. It >> does its job in providing all the operation details very well, but I >> bet most of users strongly dream

[PATCH] receive-pack: update comment with check_everything_connected

2018-09-21 Thread Jeff King
That function is now called "check_connected()", but we forgot to update this comment in 7043c7071c (check_everything_connected: use a struct with named options, 2016-07-15). Signed-off-by: Jeff King --- Just a minor annoyance I happened to notice while discussing in another thread. I notice

Re: credential..helper with partial url path

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 04:56:20PM +, Zych, David M wrote: > Suppose I need to use different credential.helper values for different > repositories on the same HTTPS host. Ideally I would like to be able to > write this logic using a partial URL path prefix, for example in > ~/.gitconfig >

Re: [PATCH] Add an EditorConfig file

2018-09-21 Thread brian m. carlson
On Thu, Sep 20, 2018 at 07:08:35AM -0700, Junio C Hamano wrote: > My comment was that it would be confusing if they gave contradicting > suggestions to the end user. After letting EditorConfig to enforce > one style while typing and saving, if "make style" suggests to > format it differently, it

[PATCH 5/8] submodule.c: do not copy around submodule list

2018-09-21 Thread Stefan Beller
'calculate_changed_submodule_paths' uses a local list to compute the changed submodules, and then produces the result by copying appropriate items into the result list. Instead use the result list directly and prune items afterwards using string_list_remove_empty_items. By doing so we'll have

[PATCH 6/8] submodule: fetch in submodules git directory instead of in worktree

2018-09-21 Thread Stefan Beller
This patch started as a refactoring to make 'get_next_submodule' more readable, but upon doing so, I realized that "git fetch" of the submodule actually doesn't need to be run in the submodules worktree. So let's run it in its git dir instead. That should pave the way towards fetching submodules

[PATCH 7/8] fetch: retry fetching submodules if needed objects were not fetched

2018-09-21 Thread Stefan Beller
Currently when git-fetch is asked to recurse into submodules, it dispatches a plain "git-fetch -C " (with some submodule related options such as prefix and recusing strategy, but) without any information of the remote or the tip that should be fetched. This works surprisingly well in some

[PATCH 8/8] builtin/fetch: check for submodule updates for non branch fetches

2018-09-21 Thread Stefan Beller
Gerrit, the code review tool, has a different workflow than our mailing list based approach. Usually users upload changes to a Gerrit server and continuous integration and testing happens by bots. Sometimes however a user wants to checkout a change locally and look at it locally. For this use

[PATCH 4/8] submodule: move global changed_submodule_names into fetch submodule struct

2018-09-21 Thread Stefan Beller
The `changed_submodule_names` are only used for fetching, so let's make it part of the struct that is passed around for fetching submodules. Signed-off-by: Stefan Beller --- submodule.c | 42 +++--- 1 file changed, 23 insertions(+), 19 deletions(-) diff

[PATCH 3/8] submodule.c: sort changed_submodule_names before searching it

2018-09-21 Thread Stefan Beller
We can string_list_insert() to maintain sorted-ness of the list as we find new items, or we can string_list_append() to build an unsorted list and sort it at the end just once. To pick which one is more appropriate, we notice the fact that we discover new items more or less in the already sorted

[PATCH 1/8] sha1-array: provide oid_array_filter

2018-09-21 Thread Stefan Beller
Helped-by: Junio C Hamano Signed-off-by: Stefan Beller --- sha1-array.c | 17 + sha1-array.h | 9 + 2 files changed, 26 insertions(+) diff --git a/sha1-array.c b/sha1-array.c index b94e0ec0f5e..d922e94e3fc 100644 --- a/sha1-array.c +++ b/sha1-array.c @@ -77,3 +77,20 @@

[PATCH 2/8] submodule.c: fix indentation

2018-09-21 Thread Stefan Beller
The submodule subsystem is really bad at staying within 80 characters. Fix it while we are here. Signed-off-by: Stefan Beller --- submodule.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/submodule.c b/submodule.c index ed05339b588..67469a8f513 100644 ---

[PATCHv3 0/8] fetch: make sure submodule oids are fetched

2018-09-21 Thread Stefan Beller
v3: * I discovered some issues with v2 after sending, which is why I rewrote the later patches completely and now we pass around a "task" struct that contains everything to know about the things to work on and what needs free()ing afterwards. * as it is no longer string list based, this

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 03:23:40PM -0700, Junio C Hamano wrote: > >> > +git config receive.advertisealternates true && > >> > >> Hmph. Do we have code to support this configuration variable? > > > > Sorry, I should have caught that. Our existing solution is to disable > >

Re: Very simple popen() code request, ground-shaking functionality openned by it

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 09:34:14AM -0400, Sebastian Gniazdowski wrote: > Git default progress indicator for clone is very unattractive, IMO. It > does its job in providing all the operation details very well, but I > bet most of users strongly dream about a gauge box! > > Have a look at my gauge

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Junio C Hamano
Jeff King writes: > On Fri, Sep 21, 2018 at 02:09:08PM -0700, Junio C Hamano wrote: > >> > +test_expect_success 'setup' ' >> > + test_commit one && >> > + git update-ref refs/heads/a HEAD && >> > + test_commit two && >> > + git update-ref refs/heads/b HEAD && >> > + test_commit three && >>

Re: [PATCH v2 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Stefan Beller
On Fri, Sep 21, 2018 at 3:18 PM Jeff King wrote: > I agree that core.* is kind of a kitchen sink, but I'm not sure that's > all that bad. Is "here is how Git finds refs in an alternate" any more This touches both "refs" and "alternates", which are Git concepts whereas ssh is not. > or less

Re: [PATCH] Add an EditorConfig file

2018-09-21 Thread brian m. carlson
On Thu, Sep 20, 2018 at 10:35:04PM -0400, Jeff King wrote: > On Thu, Sep 20, 2018 at 10:26:47PM -0400, Eric Sunshine wrote: > > > On Wed, Sep 19, 2018 at 8:00 PM brian m. carlson > > wrote: > > > (I am having trouble getting make style to work, though, because it > > > seems to invoke

Re: [PATCH v2 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 03:06:43PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > There's no extension necessary; these should already affect upload-pack > > as well. I agree transport.* would cover both upload-pack and > > receive-pack. If we extend it to check_everything_connected(),

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 02:09:08PM -0700, Junio C Hamano wrote: > > +test_expect_success 'setup' ' > > + test_commit one && > > + git update-ref refs/heads/a HEAD && > > + test_commit two && > > + git update-ref refs/heads/b HEAD && > > + test_commit three && > > + git update-ref

[PATCH] string-list: add string_list_{pop, last} functions

2018-09-21 Thread Stefan Beller
Add a few functions to allow a string-list to be used as a stack: - string_list_last() lets a caller peek the string_list_item at the end of the string list. The caller needs to be aware that it is borrowing a pointer, which can become invalid if/when the string_list is resized. -

Re: [PATCH v2 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Junio C Hamano
Jeff King writes: > There's no extension necessary; these should already affect upload-pack > as well. I agree transport.* would cover both upload-pack and > receive-pack. If we extend it to check_everything_connected(), would it > make sense as part of transport.*, too? > > I dunno. I guess I

Re: [PATCH v2 1/2] commit-graph write: add progress output

2018-09-21 Thread Junio C Hamano
Junio C Hamano writes: >> The above prototype change seems to have created a semantic conflict >> with ds/commit-graph-tests (859fdc "commit-graph: define >> GIT_TEST_COMMIT_GRAPH") because when GIT_TEST_COMMIT_GRAPH is set, we >> call write_commit_graph_reachable() but the final parameter was

Re: [PATCH v2 1/2] commit-graph write: add progress output

2018-09-21 Thread Junio C Hamano
Derrick Stolee writes: > On 9/7/2018 2:29 PM, Ævar Arnfjörð Bjarmason wrote: >> -void write_commit_graph_reachable(const char *obj_dir, int append); >> +void write_commit_graph_reachable(const char *obj_dir, int append, >> + int report_progress); >> void

Re: [PATCH v2 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Jeff King
On Fri, Sep 21, 2018 at 02:14:17PM -0700, Junio C Hamano wrote: > Taylor Blau writes: > > > +core.alternateRefsPrefixes:: > > + When listing references from an alternate, list only references that > > begin > > + with the given prefix. Prefixes match as if they were given as > > arguments

Re: [PATCH v3 0/7] Use generation numbers for --topo-order

2018-09-21 Thread Junio C Hamano
"Derrick Stolee via GitGitGadget" writes: > Changes in V3: I added a new patch that updates the tab-alignment for flags > in revision.h before adding new ones (Thanks, Ævar!). This is most unwelcome while other topics are in flight that caused unnecessary conflict. It would have been very

Re: [PATCH v2 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Junio C Hamano
Taylor Blau writes: > +core.alternateRefsPrefixes:: > + When listing references from an alternate, list only references that > begin > + with the given prefix. Prefixes match as if they were given as > arguments to > + linkgit:git-for-each-ref[1]. To list multiple prefixes,

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Eric Sunshine
On Fri, Sep 21, 2018 at 2:47 PM Taylor Blau wrote: > When in a repository containing one or more alternates, Git would > sometimes like to list references from its alternates. For example, 'git > receive-pack' list the objects pointed to by alternate references as > special ".have" references. >

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Junio C Hamano
Taylor Blau writes: > +core.alternateRefsCommand:: > + When listing references from an alternate (e.g., in the case of > ".have"), use It is not clear how (e.g.,...) connects to what is said in the sentence. "When advertising tips of available history from an alternate, use ..." without

Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines

2018-09-21 Thread Matthew DeVore
On Thu, Sep 20, 2018 at 7:06 PM Eric Sunshine wrote: > > On Thu, Sep 20, 2018 at 9:43 PM Matthew DeVore wrote: > > Add two guidelines: > > Probably s/two/three/ or s/two/several/ since the patch now adds three > guidelines. > > > - pipe characters should appear at the end of lines, and not

[PATCH v9 5/8] revision: mark non-user-given objects instead

2018-09-21 Thread Matthew DeVore
Currently, list-objects.c incorrectly treats all root trees of commits as USER_GIVEN. Also, it would be easier to mark objects that are non-user-given instead of user-given, since the places in the code where we access an object through a reference are more obvious than the places where we access

[PATCH v9 6/8] list-objects-filter: use BUG rather than die

2018-09-21 Thread Matthew DeVore
In some cases in this file, BUG makes more sense than die. In such cases, a we get there from a coding error rather than a user error. 'return' has been removed following some instances of BUG since BUG does not return. Signed-off-by: Matthew DeVore --- list-objects-filter.c | 11 ---

[PATCH v9 7/8] list-objects-filter-options: do not over-strbuf_init

2018-09-21 Thread Matthew DeVore
The function gently_parse_list_objects_filter is either called with errbuf=STRBUF_INIT or errbuf=NULL, but that function calls strbuf_init when errbuf is not NULL. strbuf_init is only necessary if errbuf contains garbage, and risks a memory leak if errbuf already has a non-STRBUF_INIT state. It

[PATCH v9 8/8] list-objects-filter: implement filter tree:0

2018-09-21 Thread Matthew DeVore
Teach list-objects the "tree:0" filter which allows for filtering out all tree and blob objects (unless other objects are explicitly specified by the user). The purpose of this patch is to allow smaller partial clones. The name of this filter - tree:0 - does not explicitly specify that it also

[PATCH v9 4/8] rev-list: handle missing tree objects properly

2018-09-21 Thread Matthew DeVore
Previously, we assumed only blob objects could be missing. This patch makes rev-list handle missing trees like missing blobs. The --missing=* and --exclude-promisor-objects flags now work for trees as they already do for blobs. This is demonstrated in t6112. Signed-off-by: Matthew DeVore ---

[PATCH v9 2/8] list-objects: refactor to process_tree_contents

2018-09-21 Thread Matthew DeVore
This will be used in a follow-up patch to reduce indentation needed when invoking the logic conditionally. i.e. rather than: if (foo) { while (...) { /* this is very indented */ } } we will have: if (foo) process_tree_contents(...); Signed-off-by:

[PATCH v9 3/8] list-objects: always parse trees gently

2018-09-21 Thread Matthew DeVore
If parsing fails when revs->ignore_missing_links and revs->exclude_promisor_objects are both false, we print the OID anyway in the die("bad tree object...") call, so any message printed by parse_tree_gently() is superfluous. Signed-off-by: Matthew DeVore --- list-objects.c | 4 +--- 1 file

[PATCH v9 0/8] filter: support for excluding all trees and blobs

2018-09-21 Thread Matthew DeVore
Since v8, I cleaned up the test scripts in the following ways: - correct order of expect/actual arguments to test_cmp - correct pipe placement - put flags before positional arguments Also, removed some junk in the commit message of the 5th patch. Thank you, Matthew DeVore (8):

[PATCH v9 1/8] list-objects: store common func args in struct

2018-09-21 Thread Matthew DeVore
This will make utility functions easier to create, as done by the next patch. Signed-off-by: Matthew DeVore --- list-objects.c | 158 +++-- 1 file changed, 74 insertions(+), 84 deletions(-) diff --git a/list-objects.c b/list-objects.c index

Re: [PATCH v2 1/2] connected: document connectivity in partial clones

2018-09-21 Thread Junio C Hamano
Jonathan Tan writes: > In acb0c57260 ("fetch: support filters", 2017-12-08), check_connected() > was extended to allow objects to either be promised to be available (if > the repository is a partial clone) or to be present; previously, this > function required the latter. However, this change

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Eric Sunshine
On Fri, Sep 21, 2018 at 2:47 PM Taylor Blau wrote: > When in a repository containing one or more alternates, Git would > sometimes like to list references from its alternates. For example, 'git > receive-pack' list the objects pointed to by alternate references as > special ".have" references. >

Re: [PATCH v2 1/2] commit-graph write: add progress output

2018-09-21 Thread Derrick Stolee
On 9/7/2018 2:29 PM, Ævar Arnfjörð Bjarmason wrote: -void write_commit_graph_reachable(const char *obj_dir, int append); +void write_commit_graph_reachable(const char *obj_dir, int append, + int report_progress); void write_commit_graph(const char *obj_dir,

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Junio C Hamano
Taylor Blau writes: > In fact, I think that we can go even further: since we don't need to > catch the beginning '^.*' (without -o), we can instead: > > extract_haves () { > depacketize - | grep '\.have' | sed -e 's/\\0.*$//g' > } Do not pipe grep into sed, unless you have an overly

Re: [PATCH] fetch: Ensure that fetch.recurseSubmodules overrides submodule.recurse.

2018-09-21 Thread Stefan Beller
On Fri, Sep 21, 2018 at 12:00 PM Marc Branchaud wrote: > > Also document this fact. > > Signed-off-by: Marc Branchaud > --- > > I ran into this bug when I had both fetch.recurseSubmodules=on-demand and > submodule.recurse=true, and submodule.recurse was set *after* > fetch.recurseSubmodules in

[PATCH] fetch: Ensure that fetch.recurseSubmodules overrides submodule.recurse.

2018-09-21 Thread Marc Branchaud
Also document this fact. Signed-off-by: Marc Branchaud --- I ran into this bug when I had both fetch.recurseSubmodules=on-demand and submodule.recurse=true, and submodule.recurse was set *after* fetch.recurseSubmodules in my config. The fix ensures that fetch.recurseSubmodules always overrides

[PATCH v2 1/3] transport.c: extract 'fill_alternate_refs_command'

2018-09-21 Thread Taylor Blau
To list alternate references, 'read_alternate_refs' creates a child process running 'git for-each-ref' in the alternate's Git directory. Prepare to run other commands besides 'git for-each-ref' by introducing and moving the relevant code from 'read_alternate_refs' to

[PATCH v2 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Taylor Blau
The recently-introduced "core.alternateRefsCommand" allows callers to specify with high flexibility the tips that they wish to advertise from alternates. This flexibility comes at the cost of some inconvenience when the caller only wishes to limit the advertisement to one or more prefixes. For

[PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Taylor Blau
When in a repository containing one or more alternates, Git would sometimes like to list references from its alternates. For example, 'git receive-pack' list the objects pointed to by alternate references as special ".have" references. Listing ".have" references is designed to make pushing

[PATCH v2 0/3] Filter alternate references

2018-09-21 Thread Taylor Blau
Hi, Attached is the second re-roll of my series to teach "core.alternateRefsCommand" and "core.alternateRefsPrefixes". I have included a range-diff below (which I have taught my scripts to do by default now), but will summarize the changes as usual: * Clean up t5410 according to Peff's

[PATCH v2 0/2] Check presence of targets when fetching to partial clone

2018-09-21 Thread Jonathan Tan
New in v2: - added patch to clarify in documentation what check_connected() does - renamed quickfetch() to check_exist_and_connected() to better reflect what it does - also updated its documentation; I avoided usage of "wanted objects" and used "fetch targets" instead to clarify that I'm

[PATCH v2 2/2] fetch: in partial clone, check presence of targets

2018-09-21 Thread Jonathan Tan
When fetching an object that is known as a promisor object to the local repository, the connectivity check in quickfetch() in builtin/fetch.c succeeds, causing object transfer to be bypassed. However, this should not happen if that object is merely promised and not actually present. Because this

[PATCH v2 1/2] connected: document connectivity in partial clones

2018-09-21 Thread Jonathan Tan
In acb0c57260 ("fetch: support filters", 2017-12-08), check_connected() was extended to allow objects to either be promised to be available (if the repository is a partial clone) or to be present; previously, this function required the latter. However, this change was not reflected in the

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Taylor Blau
On Fri, Sep 21, 2018 at 01:48:25PM -0400, Taylor Blau wrote: > On Fri, Sep 21, 2018 at 09:39:14AM -0700, Junio C Hamano wrote: > > Taylor Blau writes: > > > > > +extract_haves () { > > > + depacketize - | grep -o '^.* \.have' > > > > Not portable, isn't it? > > > > cf.

Re: [PATCH 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Taylor Blau
On Fri, Sep 21, 2018 at 09:45:11AM -0700, Junio C Hamano wrote: > Taylor Blau writes: > > > ...' block with your suggestion above. It's tempting to introduce it as: > > > > expect_haves() { > > printf "%s .have\n" $(git rev-parse -- $@) > > } > > > > And call it as: > > > > expect_haves

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Taylor Blau
On Fri, Sep 21, 2018 at 09:39:14AM -0700, Junio C Hamano wrote: > Taylor Blau writes: > > > +extract_haves () { > > + depacketize - | grep -o '^.* \.have' > > Not portable, isn't it? > > cf. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html Good catch. Definitely not

Re: [PATCH 9/9] commit-reach.h: add missing declarations (hdr-check)

2018-09-21 Thread Derrick Stolee
On 9/20/2018 11:35 AM, Ramsay Jones wrote: On 20/09/18 00:38, Derrick Stolee wrote: On 9/18/2018 8:15 PM, Ramsay Jones wrote: Signed-off-by: Ramsay Jones ---   commit-reach.h | 5 +++--   1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commit-reach.h b/commit-reach.h index

Re: [PATCH] fetch-object.h: add missing declaration (hdr-check)

2018-09-21 Thread Derrick Stolee
On 9/21/2018 1:05 PM, Junio C Hamano wrote: Ramsay Jones writes: BTW, I notice that patch #9 (commit-reach.h: add missing declarations (hdr-check)) didn't make it onto 'pu' - was there something else I needed to do? (I am still in two minds about sending an RFC patch on-top of patch #9). I

[PATCH v3 5/7] commit/revisions: bookkeeping before refactoring

2018-09-21 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee There are a few things that need to move around a little before making a big refactoring in the topo-order logic: 1. We need access to record_author_date() and compare_commits_by_author_date() in revision.c. These are used currently by sort_in_topological_order() in

[PATCH v3 7/7] revision.c: refactor basic topo-order logic

2018-09-21 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee When running a command like 'git rev-list --topo-order HEAD', Git performed the following steps: 1. Run limit_list(), which parses all reachable commits, adds them to a linked list, and distributes UNINTERESTING flags. If all unprocessed commits are UNINTERESTING,

[PATCH v3 3/7] test-reach: add rev-list tests

2018-09-21 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The rev-list command is critical to Git's functionality. Ensure it works in the three commit-graph environments constructed in t6600-test-reach.sh. Here are a few important types of rev-list operations: * Basic: git rev-list --topo-order HEAD * Range: git rev-list

[PATCH v3 6/7] revision.h: add whitespace in flag definitions

2018-09-21 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee In anticipation of adding longer flag names in the next change, add an extra tab to each flag definition in revision.h. Signed-off-by: Derrick Stolee --- revision.h | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git

[PATCH v3 4/7] revision.c: begin refactoring --topo-order logic

2018-09-21 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee When running 'git rev-list --topo-order' and its kin, the topo_order setting in struct rev_info implies the limited setting. This means that the following things happen during prepare_revision_walk(): * revs->limited implies we run limit_list() to walk the entire

[PATCH v3 1/7] prio-queue: add 'peek' operation

2018-09-21 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee When consuming a priority queue, it can be convenient to inspect the next object that will be dequeued without actually dequeueing it. Our existing library did not have such a 'peek' operation, so add it as prio_queue_peek(). Add a reference-level comparison in

[PATCH v3 2/7] test-reach: add run_three_modes method

2018-09-21 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The 'test_three_modes' method assumes we are using the 'test-tool reach' command for our test. However, we may want to use the data shape of our commit graph and the three modes (no commit-graph, full commit-graph, partial commit-graph) for other git commands. Split

[PATCH v3 0/7] Use generation numbers for --topo-order

2018-09-21 Thread Derrick Stolee via GitGitGadget
This patch series performs a decently-sized refactoring of the revision-walk machinery. Well, "refactoring" is probably the wrong word, as I don't actually remove the old code. Instead, when we see certain options in the 'rev_info' struct, we redirect the commit-walk logic to a new set of methods

Re: What's cooking in git.git (Sep 2018, #04; Thu, 20)

2018-09-21 Thread Junio C Hamano
Johannes Sixt writes: > Am 21.09.18 um 07:22 schrieb Junio C Hamano: >> The tip of 'next' hasn't been rewound yet. The three GSoC "rewrite >> in C" topics are still unclassified in this "What's cooking" report, >> but I am hoping that we can have them in 'next' sooner rather than >> later. I

Re: What's cooking in git.git (Sep 2018, #04; Thu, 20)

2018-09-21 Thread Johannes Sixt
Am 21.09.18 um 07:22 schrieb Junio C Hamano: > The tip of 'next' hasn't been rewound yet. The three GSoC "rewrite > in C" topics are still unclassified in this "What's cooking" report, > but I am hoping that we can have them in 'next' sooner rather than > later. I got an impression that Dscho

Re: [PATCH] fetch-object.h: add missing declaration (hdr-check)

2018-09-21 Thread Junio C Hamano
Ramsay Jones writes: > BTW, I notice that patch #9 (commit-reach.h: add missing declarations > (hdr-check)) didn't make it onto 'pu' - was there something else I > needed to do? (I am still in two minds about sending an RFC patch > on-top of patch #9). I refrained from queuing it as I did not

credential..helper with partial url path

2018-09-21 Thread Zych, David M
Suppose I need to use different credential.helper values for different repositories on the same HTTPS host. Ideally I would like to be able to write this logic using a partial URL path prefix, for example in ~/.gitconfig [credential "https://example.com/prefix1/foo.git;] helper =

Re: [PATCH 2/3] git-column.1: clarify initial description, provide examples

2018-09-21 Thread frederik
Thank you Junio, maybe I will have another chance to get practice sending a v2 patch. On Fri, Sep 21, 2018 at 09:32:00AM -0700, Junio C Hamano wrote: > frede...@ofb.net writes: > > > On Thu, Sep 20, 2018 at 06:23:03PM +0200, Duy Nguyen wrote: > >> On Wed, Sep 19, 2018 at 03:59:58PM -0700, Junio

Re: [PATCH] fetch-object.h: add missing declaration (hdr-check)

2018-09-21 Thread Ramsay Jones
On 21/09/18 17:21, Junio C Hamano wrote: > Ramsay Jones writes: > >> Signed-off-by: Ramsay Jones >> --- >> >> Hi Junio, >> >> This is the patch I needed for the current 'next' branch to get >> a clean 'hdr-check' > > Which means that this is a fix on top of jt/lazy-object-fetch-fix > topic,

Re: [PATCH v5 17/23] userdiff.c: remove implicit dependency on the_index

2018-09-21 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > diff --git a/userdiff.h b/userdiff.h > index 2ef0ce5452..dad3fc03c1 100644 > --- a/userdiff.h > +++ b/userdiff.h > @@ -21,7 +21,8 @@ struct userdiff_driver { > > int userdiff_config(const char *k, const char *v); > struct userdiff_driver

Re: [PATCH 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Junio C Hamano
Taylor Blau writes: > ...' block with your suggestion above. It's tempting to introduce it as: > > expect_haves() { > printf "%s .have\n" $(git rev-parse -- $@) > } > > And call it as: > > expect_haves one three two >expect > > But I'm not sure whether I think that this is better or

Re: [PATCH 3/3] transport.c: introduce core.alternateRefsPrefixes

2018-09-21 Thread Junio C Hamano
Eric Sunshine writes: > On Thu, Sep 20, 2018 at 2:04 PM Taylor Blau wrote: >> The recently-introduced "core.alternateRefsCommand" allows callers to >> specify with high flexibility the tips that they wish to advertise from >> alternates. This flexibility comes at the cost of some inconvenience

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Junio C Hamano
Taylor Blau writes: > +extract_haves () { > + depacketize - | grep -o '^.* \.have' Not portable, isn't it? cf. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html

Re: [PATCH 2/3] git-column.1: clarify initial description, provide examples

2018-09-21 Thread Junio C Hamano
frede...@ofb.net writes: > On Thu, Sep 20, 2018 at 06:23:03PM +0200, Duy Nguyen wrote: >> On Wed, Sep 19, 2018 at 03:59:58PM -0700, Junio C Hamano wrote: >> > > @@ -23,7 +26,7 @@ OPTIONS >> > > >> > > --mode=:: >> > > Specify layout mode. See configuration variable column.ui for >> >

Re: [PATCH] userdiff.h: add missing declaration (hdr-check)

2018-09-21 Thread Duy Nguyen
On Fri, Sep 21, 2018 at 6:24 PM Junio C Hamano wrote: > > Ramsay Jones writes: > > > Signed-off-by: Ramsay Jones > > --- > > > > Hi Junio, > > > > ... and this is the patch I needed for the current 'pu' branch. > > Which in turn means that this is to fix 5b338d60 ("userdiff.c: > remove implicit

Re: [PATCH] userdiff.h: add missing declaration (hdr-check)

2018-09-21 Thread Junio C Hamano
Ramsay Jones writes: > Signed-off-by: Ramsay Jones > --- > > Hi Junio, > > ... and this is the patch I needed for the current 'pu' branch. Which in turn means that this is to fix 5b338d60 ("userdiff.c: remove implicit dependency on the_index", 2018-09-15) and should be rolled into nd/the_index

Re: [PATCH] fetch-object.h: add missing declaration (hdr-check)

2018-09-21 Thread Junio C Hamano
Ramsay Jones writes: > Signed-off-by: Ramsay Jones > --- > > Hi Junio, > > This is the patch I needed for the current 'next' branch to get > a clean 'hdr-check' Which means that this is a fix on top of jt/lazy-object-fetch-fix topic, I think. Will apply there. Thanks.

Re: [PATCH v5 9/9] submodule: support reading .gitmodules when it's not in the working tree

2018-09-21 Thread Junio C Hamano
Antonio Ospite writes: > Protecting the problematic submodules function could work for now, but > I'd like to have more comments, my proposal is: > > diff --git a/builtin/grep.c b/builtin/grep.c > index 601f801158..52b45de749 100644 > --- a/builtin/grep.c > +++ b/builtin/grep.c > @@ -427,6

Re: git check-ignore ignores negated entries

2018-09-21 Thread Duy Nguyen
On Thu, Sep 20, 2018 at 7:25 PM David Alphus wrote: > In looking through check-ignore.c, it appears that we check that > last_exclude_matching() returns an exclude object. It should be noted > that we do not consider that exclude struct can be set with the > EXC_FLAG_NEGATIVE flag. This flag says

Re: [RFC PATCH v4 1/3] Add support for nested aliases

2018-09-21 Thread Junio C Hamano
Tim Schumacher writes: > it is located at the top of the while() loop. Giving an example is nice, but > wouldn't > it be better to say something like the following? > > /* >* Check if av[0] is a command before seeing if it is an >* alias to avoid taking over existing

[PATCH v5 21/23] ws.c: remove implicit dependency on the_index

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- apply.c | 8 +--- cache.h | 2 +- diff.c | 6 +++--- ws.c| 5 ++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apply.c b/apply.c index 571b89c2e0..fdae1d423b 100644 --- a/apply.c +++ b/apply.c

[PATCH v5 22/23] revision.c: remove implicit dependency on the_index

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- .../technical/api-revision-walking.txt| 4 +-- bisect.c | 4 +-- builtin/add.c | 4 +-- builtin/am.c | 6 ++--

[PATCH v5 23/23] revision.c: reduce implicit dependency the_repository

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- list-objects.c | 8 +--- revision.c | 44 +++- revision.h | 2 +- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/list-objects.c b/list-objects.c index

[PATCH v5 17/23] userdiff.c: remove implicit dependency on the_index

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- archive-zip.c | 14 +- builtin/grep.c | 3 ++- combine-diff.c | 2 +- diff.c | 40 +++- diff.h | 3 ++- diffcore-pickaxe.c | 4 ++--

[PATCH v5 19/23] submodule.c: remove implicit dependency on the_index

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/pull.c | 2 +- submodule.c| 28 +--- submodule.h| 9 ++--- transport.c| 9 ++--- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/builtin/pull.c

[PATCH v5 15/23] sha1-file.c: remove implicit dependency on the_index

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/difftool.c | 2 +- builtin/hash-object.c | 2 +- builtin/replace.c | 2 +- builtin/update-index.c | 2 +- cache.h| 4 ++-- diff.c | 20 - notes-merge.c

[PATCH v5 18/23] line-range.c: remove implicit dependency on the_index

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/blame.c | 2 +- line-log.c | 4 ++-- line-range.c| 22 ++ line-range.h| 6 -- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c

[PATCH v5 20/23] tree-diff.c: remove implicit dependency on the_index

2018-09-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- tree-diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-diff.c b/tree-diff.c index 57a15f51f0..16b28ff6d6 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -605,7 +605,7 @@ static void

  1   2   >