[PATCH v10 2/6] http: always warn if libcurl version is too old

2016-12-14 Thread Brandon Williams
llowed/disallowed by 'is_transport_allowed' which older version of libcurl can't respect. Signed-off-by: Brandon Williams --- http.c | 5 ++--- transport.c | 5 - transport.h | 6 -- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/http.c b/http.c index 5cd3ffd..03442

[PATCH v10 4/6] http: create function to get curl allowed protocols

2016-12-14 Thread Brandon Williams
Move the creation of an allowed protocols whitelist to a helper function. This will be useful when we need to compute the set of allowed protocols differently for normal and redirect cases. Signed-off-by: Brandon Williams --- http.c | 31 --- 1 file changed, 20

[PATCH v10 3/6] transport: add protocol policy config option

2016-12-14 Thread Brandon Williams
atch by Jeff King Signed-off-by: Brandon Williams --- Documentation/config.txt | 46 ++ Documentation/git.txt| 38 +--- git-submodule.sh | 12 ++-- t/lib-proto-disable.sh | 130 +-- t/t5509-

[RFC/PATCH] ls-files: adding support for submodules

2016-09-09 Thread Brandon Williams
Allow ls-files to recognize submodules in order to retrieve a list of files from a repository's submodules. This is done by forking off a process to recursively call ls-files on all submodules. Signed-off-by: Brandon Williams --- Hey git developers! I'm new to the community and t

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-12 Thread Brandon Williams
Thanks for all the comments. What it sounds like is that using ls-files as a means to power a recursive git-grep may not be like the best approach (I assumed that would be the case but thought it a decent place to start). I agree that not all operating modes would be useful for a recursive ls-fil

[PATCH v2] ls-files: adding support for submodules

2016-09-12 Thread Brandon Williams
ff-by: Brandon Williams --- Documentation/git-ls-files.txt | 11 +++- builtin/ls-files.c | 60 + t/t3007-ls-files-recurse-submodules.sh | 99 ++ 3 files changed, 169 insertions(+), 1 deletion(-) create mode 100755 t/t30

Re: [PATCH v2] ls-files: adding support for submodules

2016-09-12 Thread Brandon Williams
> static void write_name(const char *name) > { > /* > +* NEEDSWORK: To make this thread-safe, full_name would have to be > owned > +* by the caller. > +* > +* full_name get reused across output lines to minimize the allocation > +* churn. > +

[PATCH] pathspec: removed unnecessary function prototypes

2016-09-13 Thread Brandon Williams
removed function prototypes from pathspec.h which don't have a corresponding implementation. Signed-off-by: Brandon Williams --- pathspec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/pathspec.h b/pathspec.h index 4a80f6f..59809e4 100644 --- a/pathspec.h +++ b/pathspec.h @@ -96,7

Re: [PATCH] pathspec: removed unnecessary function prototypes

2016-09-14 Thread Brandon Williams
On Wed, Sep 14, 2016 at 12:23 PM, Jeff King wrote: > On Tue, Sep 13, 2016 at 11:15:52AM -0700, Jeff King wrote: > I should have done a better job of not just providing the answer, but > showing how. The easiest tool here is "git log -S": > > git log -1 -p -Scheck_path_for_gitlink > > (and then

[RFC] extending pathspec support to submodules

2016-09-14 Thread Brandon Williams
--- I've been trying to think through how we could potentially add pathspec support for --recurse-submodule options (for builtins like ls-files or grep down the line).  This is something that could be useful if the user supply's a pathspec that could match to a file in a submodule.  We could match

Re: [RFC] extending pathspec support to submodules

2016-09-15 Thread Brandon Williams
On Thu, Sep 15, 2016 at 4:57 AM, Heiko Voigt wrote: > > The problem when you do that is that the child is not aware that it is > actually run as a submodule process. E.g. > >git grep --recurse-submodules foobar -- sub/dir/a > > would report back matches in 'dir/a' instead of 'sub/dir/a'. From

Re: [PATCH 2/2] SQUASH??? Undecided

2016-09-15 Thread Brandon Williams
Yeah if that is the convention then I have no problem with the change. -Brandon On Thu, Sep 15, 2016 at 2:12 PM, Stefan Beller wrote: > + cc Brandon > > On Thu, Sep 15, 2016 at 1:51 PM, Junio C Hamano wrote: >> If we were to follow the convention to leave an optional string >> variable to NULL,

Re: [RFC] extending pathspec support to submodules

2016-09-16 Thread Brandon Williams
On Thu, Sep 15, 2016 at 3:08 PM, Junio C Hamano wrote: > > * Your program that runs in the top-level superproject still needs >to be able to say "this pathspec from the top cannot possibly >match anything in the submodule, so let's not even bother >descending into it". > Yes, we woul

[PATCH] ls-files: add pathspec matching for submodules

2016-09-16 Thread Brandon Williams
Pathspecs can be a bit tricky when trying to apply them to submodules. This change permits the pathspec logic to perform a prefix match against submodules since a pathspec could refer to a file inside of a submodule. Signed-off-by: Brandon Williams --- Documentation/git-ls-files.txt

Re: [PATCH] ls-files: add pathspec matching for submodules

2016-09-18 Thread Brandon Williams
On Fri, Sep 16, 2016 at 8:46 PM, Junio C Hamano wrote: > > As the previous one that used a wrong (sorry) argument is not even > in 'next' yet, let's pretend that it never happened. It is OK to > still keep it and this patch as two separate steps, i.e. a topic > with two patches in it. Yeah since

Re: [PATCH] ls-files: add pathspec matching for submodules

2016-09-19 Thread Brandon Williams
On Mon, Sep 19, 2016 at 10:00 AM, Junio C Hamano wrote: > > I think you were clear enough. > > Don't read everything other people say in their reviews as pointing > out issues. Often trying to rephrase what they read in the code in > their own words is a good way to make sure the reviewers and th

Re: [PATCH] ls-files: add pathspec matching for submodules

2016-09-19 Thread Brandon Williams
On Mon, Sep 19, 2016 at 11:04 AM, Junio C Hamano wrote: > Brandon Williams writes: > >>> Again, what do we have in "name" and "item" at this point? If we >>> have a submodule at "sub/" and we are checking a pathspec element >>>

Re: [PATCH] ls-files: add pathspec matching for submodules

2016-09-19 Thread Brandon Williams
side question if the answer is short: Any reason as to why all of the pathspec matching code lives inside of dir.c and not pathspec.c? On Mon, Sep 19, 2016 at 11:22 AM, Junio C Hamano wrote: > Brandon Williams writes: > >> Yes in that case it wouldn't have passed ps_strncmp(

Re: [PATCH] ls-files: add pathspec matching for submodules

2016-09-19 Thread Brandon Williams
I thought as much. Thanks for the quick explanation :) On Mon, Sep 19, 2016 at 11:34 AM, Junio C Hamano wrote: > Brandon Williams writes: > >> side question if the answer is short: Any reason as to why all of the >> pathspec matching code lives inside of dir.c

[PATCH v2] ls-files: add pathspec matching for submodules

2016-09-19 Thread Brandon Williams
logic to perform a prefix match against submodules since a pathspec could refer to a file inside of a submodule. This can can result in false positive matches since a super module doesn't know what files could be in the submodule. Signed-off-by: Brandon Williams --- Documentation/git-ls-file

Re: [PATCH v2] ls-files: add pathspec matching for submodules

2016-09-20 Thread Brandon Williams
On Mon, Sep 19, 2016 at 4:21 PM, Junio C Hamano wrote: > > As the previous one that used a wrong (sorry) argument is not even > in 'next' yet, let's pretend that it never happened. It is OK to > still keep it and this patch as two separate steps, i.e. a topic > with two patches in it. > > That me

Re: [PATCH v2] ls-files: add pathspec matching for submodules

2016-09-20 Thread Brandon Williams
>>> + >>> + if (item->flags & PATHSPEC_ONESTAR) { >>> + return WM_MATCH; >>> + } else if (item->magic & PATHSPEC_GLOB) { >>> + return wildmatch(pattern, string, >>> + WM_PATHNAME | >>> + (item->magic & PATHSPE

[PATCH 2/2] ls-files: add pathspec matching for submodules

2016-09-21 Thread Brandon Williams
More accurate matching will be done once inside the submodule. This is due to the super module not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams --- builtin/ls-files.c | 132 -

[PATCH 1/2] ls-files: adding support for submodules

2016-09-21 Thread Brandon Williams
ff-by: Brandon Williams --- Documentation/git-ls-files.txt | 11 +++- builtin/ls-files.c | 61 + t/t3007-ls-files-recurse-submodules.sh | 99 ++ 3 files changed, 170 insertions(+), 1 deletion(-) create mode 100755 t/t30

Re: [PATCH 1/2] ls-files: adding support for submodules

2016-09-21 Thread Brandon Williams
This is another version of the first ls-files patch i sent out in order. In this version I fixed the option name to be '--submodule-prefix'.

Re: [PATCH 1/2] ls-files: adding support for submodules

2016-09-21 Thread Brandon Williams
yes you mentioned this and I meant to change that before sending it out. Looks like it slipped through have slipped through.

[PATCH 1/2] ls-files: optionally recurse into submodules

2016-09-21 Thread Brandon Williams
ff-by: Brandon Williams --- Documentation/git-ls-files.txt | 11 +++- builtin/ls-files.c | 61 + t/t3007-ls-files-recurse-submodules.sh | 99 ++ 3 files changed, 170 insertions(+), 1 deletion(-) create mode 100755 t/t30

Re: [PATCH 2/2] ls-files: add pathspec matching for submodules

2016-09-21 Thread Brandon Williams
On Wed, Sep 21, 2016 at 3:53 PM, Junio C Hamano wrote: > > Sounds sensible. Just a minor nit in terminology, but I think we > fairly consistently say "a superproject contains submodules" (run > "git grep -E 'super *(module|project)'"). > > I'd suggest s/super module/superproject/ for consistency.

[PATCH 2/2 v2] ls-files: add pathspec matching for submodules

2016-09-21 Thread Brandon Williams
More accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams --- builtin/ls-files.c | 132 -

Re: [PATCH 1/2] ls-files: adding support for submodules

2016-09-23 Thread Brandon Williams
> Yeah, a positive "I support this" flag would at least let us correctly > flag errors, which is the best we can do. That won't work for > non-builtins, but perhaps it is good enough in practice. > > -Peff So it sounds like we agree that this prefix option should be pushed to the top level. The q

Re: [PATCH 2/2 v2] ls-files: add pathspec matching for submodules

2016-09-23 Thread Brandon Williams
On Fri, Sep 23, 2016 at 12:20 PM, Junio C Hamano wrote: > There is an interesting observation around this code. Note that it > is just something to keep in mind, even though I think we are in no > position to solve this within the scope of this series, or in fact I > am not sure if there is anyth

Re: [PATCH 1/2] ls-files: optionally recurse into submodules

2016-09-23 Thread Brandon Williams
On Wed, Sep 21, 2016 at 11:20 PM, Jeff King wrote: >> +/** >> + * Recursively call ls-files on a submodule >> + */ >> +static void show_gitlink(const struct cache_entry *ce) >> +{ >> + struct child_process cp = CHILD_PROCESS_INIT; >> + int status; >> + >> + argv_array_push(&cp.args, "l

[PATCH 0/3] recursive support for ls-files

2016-09-23 Thread Brandon Williams
n and instead have it being passed to a child process via an environment variable GIT_INTERNAL_SUBMODULE_PREFIX. This way we don't have to support anything to external users at the moment. Also fixed a bug (and added a test) for the -z options as pointed out by Jeff King. Brandon Williams (3):

[PATCH 2/3 v3] ls-files: optionally recurse into submodules

2016-09-23 Thread Brandon Williams
t can use to prepend to output or pathspec matching logic. Signed-off-by: Brandon Williams --- Documentation/git-ls-files.txt | 7 ++- builtin/ls-files.c | 63 ++ t/t3007-ls-files-recurse-submodules.sh | 99 ++ 3

[PATCH 3/3 v3] ls-files: add pathspec matching for submodules

2016-09-23 Thread Brandon Williams
More accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams --- builtin/ls-files.c | 134 -

[PATCH 1/3 v3] submodules: make submodule-prefix option an envvar

2016-09-23 Thread Brandon Williams
Add a submodule-prefix enviorment variable 'GIT_INTERNAL_SUBMODULE_PREFIX' which can be used by commands which have --recurse-submodule options. Signed-off-by: Brandon Williams --- cache.h | 1 + environment.c | 1 + 2 files changed, 2 insertions(+) diff --git a/cache.h b/cac

Re: [PATCH 0/3] recursive support for ls-files

2016-09-25 Thread Brandon Williams
On 09/25, Jeff King wrote: > On Fri, Sep 23, 2016 at 05:13:31PM -0700, Brandon Williams wrote: > > > After looking at the feedback I rerolled a few things, in particular the > > --submodule_prefix option that existed to give a submodule context about > > where >

Re: [PATCH 0/3] recursive support for ls-files

2016-09-26 Thread Brandon Williams
On 09/25, Junio C Hamano wrote: > Brandon Williams writes: > > > On 09/25, Jeff King wrote: > >> On Fri, Sep 23, 2016 at 05:13:31PM -0700, Brandon Williams wrote: > >> > >> > After looking at the feedback I rerolled a few things, in particular the >

Re: [PATCH 0/3] recursive support for ls-files

2016-09-26 Thread Brandon Williams
On 09/26, Junio C Hamano wrote: > Brandon Williams writes: > > > In a previous email you mentioned that this feature should be completely > > hidden from users, which is why I removed the command line option for > > this latest series. > > I may have said someth

Re: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

2016-09-26 Thread Brandon Williams
Interesting. Once we get something we agree on for adding the --submodule-prefix option to the top level we'll definitely have to update this section of code with the change. -- Brandon Williams

[PATCH 0/4 v4] recursive support for ls-files

2016-09-26 Thread Brandon Williams
series addresses some of issues brought up in v3 Brandon Williams (4): submodules: make submodule-prefix option ls-files: optionally recurse into submodules ls-files: pass through safe options for --recurse-submodules ls-files: add pathspec matching for submodules Documentation/git-ls

[PATCH 4/4 v4] ls-files: add pathspec matching for submodules

2016-09-26 Thread Brandon Williams
More accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams --- builtin/ls-files.c | 28 ++--- dir.c

[PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-26 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, --stage, -v, -t, -z, --debug, --eol) Signed-off-by: Brandon Williams --- builtin/ls-files.c | 34 ++ t/t3007-ls-files-recurse-submodules.sh | 17

[PATCH 2/4 v4] ls-files: optionally recurse into submodules

2016-09-26 Thread Brandon Williams
nd to output or pathspec matching logic. Signed-off-by: Brandon Williams --- Documentation/git-ls-files.txt | 7 +- builtin/ls-files.c | 143 - git.c | 2 +- t/t3007-ls-files-recurse-submodules.sh

[PATCH 1/4 v4] submodules: make submodule-prefix option

2016-09-26 Thread Brandon Williams
ned-off-by: Brandon Williams --- Documentation/git.txt | 5 + cache.h | 1 + environment.c | 1 + git.c | 19 +++ 4 files changed, 26 insertions(+) diff --git a/Documentation/git.txt b/Documentation/git.txt index 7913fc2..d29967a 10

Re: [PATCH 1/4 v4] submodules: make submodule-prefix option

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams writes: > > > +--submodule-prefix=:: > > + Set a prefix which gives submodules context about the superproject that > > + invoked it. Only allowed for commands which support submodules. > > This, and also the m

Re: [PATCH 2/4 v4] ls-files: optionally recurse into submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams writes: > > +static const char *submodule_prefix; > > I would have expected this to added to environment.c in the previous > step, but it is OK--I'd imagine you'd grab this from the environment > and carrying a pie

Re: [PATCH 4/4 v4] ls-files: add pathspec matching for submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams writes: > > > - /* Find common prefix for all pathspec's */ > > - max_prefix = common_prefix(&pathspec); > > + /* > > +* Find common prefix for all pathspec's > > +* This is used

Re: [PATCH 1/4 v4] submodules: make submodule-prefix option

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams writes: > > >> s/submodules/submodule-prefix/ at least. > > > > So should the #define be SUPPORT_SUBMODULE_PREFIX instead? That may be > > too narrow minded and not looking toward future submodule options > &

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams writes: > > > if (recurse_submodules && > > - (show_stage || show_deleted || show_others || show_unmerged || > > + (show_deleted || show_others || show_unmerged || > > show_killed

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-27 Thread Brandon Williams
; > ... > > EOF > > > > instead, perhaps? > > I actually think it would make more sense to add > > lf_to_nul () { > perl -pe 'y/\012/\000/' > } > > to t/test-lib-functions.sh somewhere near q_to_nul if we were to go > this route. my mind is drawing a blank, what does the 'lf' in 'lf_to_nul' stand for? line feed? -- Brandon Williams

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams writes: > > @@ -170,6 +171,27 @@ static void show_killed_files(struct dir_struct *dir) > > } > > } > > > > +/* > > + * Compile an argv_array with all of the options supported by > > -

Re: [PATCH 1/2] ls-files: adding support for submodules

2016-09-27 Thread Brandon Williams
ec before matching > them against the paths it finds in the index), it becomes clear that > giving both at the same time is awkward and not very useful. Well maybe...I don't really know much about how the prefix interacts in every scenario but would what you describe still work if we are in a sub dir of the superproject (which contains other directorys and perhaps a submodule) and execute a --recurse-submodules command in the subdirectory? I suspect we don't want to force users to be in the root directory of the project in order to use --recurse-submodules. -- Brandon Williams

Re: [PATCH 1/2] ls-files: adding support for submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams writes: > > > Well maybe...I don't really know much about how the prefix interacts in > > every scenario but would what you describe still work if we are in a sub > > dir of the superproject (which contains o

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-28 Thread Brandon Williams
; > ... > > EOF > > > > instead, perhaps? > > I actually think it would make more sense to add > > lf_to_nul () { > perl -pe 'y/\012/\000/' > } > > to t/test-lib-functions.sh somewhere near q_to_nul if we were to go > this route. Turns out this function already exists in test-lib-functions.sh -- Brandon Williams

[PATCH v5 1/4] git: make super-prefix option

2016-09-28 Thread Brandon Williams
they were invoked. This option is currently only allowed for builtins which support a super-prefix. Signed-off-by: Brandon Williams --- Documentation/git.txt | 6 ++ cache.h | 2 ++ environment.c | 10 ++ git.c | 22 ++ 4 fil

[PATCH v5 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-28 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, --stage, -v, -t, -z, --debug, --eol) Other options are compiled into an argv_array but if an unsafe option is given the caller will be errored out. Signed-off-by: Brandon Williams --- builtin/ls-files.c

[PATCH v5 2/4] ls-files: optionally recurse into submodules

2016-09-28 Thread Brandon Williams
nd to output or pathspec matching logic. Signed-off-by: Brandon Williams --- Documentation/git-ls-files.txt | 7 +- builtin/ls-files.c | 139 - git.c | 2 +- t/t3007-ls-files-recurse-submodules.sh

[PATCH v5 0/4] recursive support for ls-files

2016-09-28 Thread Brandon Williams
hanged the compile_submodule_options function to compile all options that can be realistically passed through and when an option that isn't supported (or rather safe) yet is provided the caller will be errored out. Brandon Williams (4): git: make super-prefix option ls-files: optionally recurse into

[PATCH v5 4/4] ls-files: add pathspec matching for submodules

2016-09-28 Thread Brandon Williams
More accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams --- builtin/ls-files.c | 28 ++--- dir.c

Re: [PATCH v5 1/4] git: make super-prefix option

2016-09-29 Thread Brandon Williams
On 09/29, Jeff King wrote: > On Wed, Sep 28, 2016 at 02:50:40PM -0700, Brandon Williams wrote: > > > Add a super-prefix environment variable 'GIT_INTERNAL_SUPER_PREFIX' > > which can be used to specify a path from above a repository down to its > > root. The

[PATCH v6 0/4] recursive support for ls-files

2016-09-29 Thread Brandon Williams
Minor fixes per the comments on version 5. Brandon Williams (4): git: make super-prefix option ls-files: optionally recurse into submodules ls-files: pass through safe options for --recurse-submodules ls-files: add pathspec matching for submodules Documentation/git-ls-files.txt

[PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-29 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, --stage, -v, -t, -z, --debug, --eol) Other options are compiled into an argv_array but if an unsafe option is given the caller will be errored out. Signed-off-by: Brandon Williams --- builtin/ls-files.c

[PATCH v6 1/4] git: make super-prefix option

2016-09-29 Thread Brandon Williams
ontext to submodules about how they were invoked. This option is currently only allowed for builtins which support a super-prefix. Signed-off-by: Brandon Williams --- Documentation/git.txt | 6 ++ cache.h | 2 ++ environment.c | 10 ++ git.c

[PATCH v6 2/4] ls-files: optionally recurse into submodules

2016-09-29 Thread Brandon Williams
nd to output or pathspec matching logic. Signed-off-by: Brandon Williams --- Documentation/git-ls-files.txt | 8 +- builtin/ls-files.c | 138 - git.c | 2 +- t/t3007-ls-files-recurse-submodules.sh

[PATCH v6 4/4] ls-files: add pathspec matching for submodules

2016-09-29 Thread Brandon Williams
More accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams --- Documentation/git-ls-files.txt | 3 +- builtin/ls-files.c | 27 +++--

Re: [PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-30 Thread Brandon Williams
On 09/29, Junio C Hamano wrote: > Brandon Williams writes: > > > +static void compile_submodule_options(const struct dir_struct *dir, int > > show_tag) > > +{ > > + if (line_terminator == '\0') > > + argv_array_push(&a

Re: [PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-30 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, -v, -t, -z, --debug, --eol) If other unsafe options are given the caller will be errored out. Signed-off-by: Brandon Williams --- Something more like this correct? I ditched the extra parameters and reworded the

Re: [PATCH] mailmap: update brandon williams's email address

2018-12-07 Thread Brandon Williams
On Fri, Dec 7, 2018 at 10:08 PM Junio C Hamano wrote: > > Stefan Beller writes: > > > On Fri, Dec 7, 2018 at 1:40 PM Jonathan Nieder wrote: > >> > >> Brandon Williams wrote: > >> > >> > Signed-off-by: Brandon Williams > >> &

Re: Weird behavior with git grep --recurse-submodules

2019-08-03 Thread Brandon Williams
On Mon, Jul 29, 2019 at 1:27 PM Matheus Tavares Bernardino wrote: > > On Tue, Jul 16, 2019 at 3:09 PM Daniel Zaoui wrote: > > > > Hi Matheus, > > Hi, Daniel > > I'm sorry, your last message went to my spam folder for some reason :( > > > Thank you for your response. > > > > I really hope the chan

[PATCH] mailmap: update brandon williams's email address

2018-12-07 Thread Brandon Williams
Signed-off-by: Brandon Williams --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index eb7b5fc7b..247a3deb7 100644 --- a/.mailmap +++ b/.mailmap @@ -27,6 +27,7 @@ Ben Walton Benoit Sigoure Bernt Hansen Brandon Casey +Brandon Williams brian m

Re: [PATCH/RFC/BUG] unpack-trees.c: do not use "the_index"

2018-06-04 Thread Brandon Williams
ex - 2018-04-23) and could > >>> potentially break things again... > > I'm pretty sure your patch is correct. Adding Brandon Williams to the > cc for comment since his patches came up in the analysis below... > > >> Actually, I don't think the patch will break

Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-04 Thread Brandon Williams
et = parse_refspec(&refspec, fetch_refspec_str, REFSPEC_FETCH); > refspec_item_clear(&refspec); > return ret; > } > -- > 2.18.0.rc0.43.gb85e7bcbff > -- Brandon Williams

Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-05 Thread Brandon Williams
uct refspec_item *item, const char *refspec, int > fetch); > +void refspec_item_init_or_die(struct refspec_item *item, const char > *refspec, int fetch); > void refspec_item_clear(struct refspec_item *item); > void refspec_init(struct refspec *rs, int fetch); > void refspec_append(struct refspec *rs, const char *refspec); > > I.e. let's fix the bug, but with this admittedly more verbose fix we're > left with exactly two memset() in refspec.c, one for each type of struct > that's initialized by the API. > > The reason this is difficult now is because the current API conflates > the init function with an init_or_die, which is what most callers want, > so let's just split those concerns up. Then we're left with one init > function that does the memset. -- Brandon Williams

Re: [PATCH 6/6] Forbid "the_index" in dir.c and unpack-trees.c

2018-06-05 Thread Brandon Williams
unpack-trees.c > @@ -1,4 +1,6 @@ > #define NO_THE_INDEX_COMPATIBILITY_MACROS > +/* Do not use the_index here, you probably want o->src_index */ > +#define NO_GLOBAL_INDEX > #include "cache.h" > #include "argv-array.h" > #include "repository.h" > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

[PATCH 6/8] fetch: refactor to make function args narrower

2018-06-05 Thread Brandon Williams
struct. Signed-off-by: Brandon Williams --- builtin/fetch.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index ee8b87c78..b600e1f10 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c

[PATCH 3/8] upload-pack: test negotiation with changing repository

2018-06-05 Thread Brandon Williams
(which will be introduced to the client in subsequent commits), and ensures that subsequent commits do not change existing behavior. As part of this effort, a mechanism to substitute strings in a single HTTP response is added. Signed-off-by: Brandon Williams --- t/lib-httpd.sh

[PATCH 4/8] fetch: refactor the population of peer ref OIDs

2018-06-05 Thread Brandon Williams
Populate peer ref OIDs in get_ref_map instead of do_fetch. Besides tightening scopes of variables in the code, this also prepares for get_ref_map being able to be called multiple times within do_fetch. Signed-off-by: Brandon Williams --- builtin/fetch.c | 36

[PATCH 8/8] fetch-pack: implement ref-in-want

2018-06-05 Thread Brandon Williams
Implement ref-in-want on the client side so that when a server supports the "ref-in-want" feature, a client will send "want-ref" lines for each reference the client wants to fetch. Signed-off-by: Brandon Williams --- fetch-pack.c

[PATCH 7/8] fetch-pack: put shallow info in output parameter

2018-06-05 Thread Brandon Williams
sometimes generate the ref map twice: once from the list of refs provided by the remote (as is currently done) and potentially once from the new list of refs that the fetch mechanism provides. Signed-off-by: Brandon Williams --- builtin/clone.c | 4 ++-- builtin/fetch.c | 23

[PATCH 5/8] fetch: refactor fetch_refs into two functions

2018-06-05 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. Signed-off-by: Brandon Williams --- builtin/fetch.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c

[PATCH 1/8] test-pkt-line: add unpack-sideband subcommand

2018-06-05 Thread Brandon Williams
Add an 'unpack-sideband' subcommand to the test-pkt-line helper to enable unpacking packet line data sent multiplexed using a sideband. Signed-off-by: Brandon Williams --- t/helper/test-pkt-line.c | 37 + 1 file changed, 37 insertions(+) diff

[PATCH 0/8] ref-in-want

2018-06-05 Thread Brandon Williams
full ref names are allowed instead of globs and OIDs), but it is meant to accomplish the same goal (solve the issues of refs changing during negotiation). Brandon Williams (8): test-pkt-line: add unpack-sideband subcommand upload-pack: implement ref-in-want upload-pack: test negotiation with

[PATCH 2/8] upload-pack: implement ref-in-want

2018-06-05 Thread Brandon Williams
want-ref " parameter. At the conclusion of negotiation, the server will send a list of all of the wanted references (as provided by "want-ref" lines) in addition to the generated packfile. Signed-off-by: Brandon Williams --- Documentation/config.txt| 4 + Docum

Re: [PATCH 0/3] refspec: refactor & fix free() behavior

2018-06-05 Thread Brandon Williams
t; builtin/pull.c | 2 +- > refspec.c | 13 + > refspec.h | 5 - > 4 files changed, 15 insertions(+), 7 deletions(-) > > -- > 2.17.0.290.gded63e768a > -- Brandon Williams

[PATCH] docs: link to gitsubmodules

2018-06-05 Thread Brandon Williams
Add a link to gitsubmodules(7) under the `submodule.active` entry in git-config(1). Signed-off-by: Brandon Williams --- Documentation/config.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index ab641bf5a

Re: [PATCH] docs: link to gitsubmodules

2018-06-05 Thread Brandon Williams
On 06/05, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Jun 05 2018, Brandon Williams wrote: > > > Add a link to gitsubmodules(7) under the `submodule.active` entry in > > git-config(1). > > Did you mean to change either the subject or content of this patch? Your >

Re: [PATCH] docs: link to gitsubmodules

2018-06-05 Thread Brandon Williams
> submodule.active:: > A repeated field which contains a pathspec used to match against a > submodule's path to determine if the submodule is of interest to git > - commands. See linkgit:git-submodule[1] for details. > + commands. See linkgit:gitsubmodules[7] for details. > > submodule.recurse:: > Specifies if commands recurse into submodules by default. This Yep this is what I meant. -- Brandon Williams

Re: [PATCH 2/2] fetch: send "refs/tags/" prefix upon CLI refspecs

2018-06-05 Thread Brandon Williams
client -c protocol.version=2 \ > + fetch "$(pwd)/server" to_fetch:to_fetch && > + > + grep "fetch> ref-prefix to_fetch" trace && > + grep "fetch> ref-prefix refs/tags/" trace && > + grep "fetch> include-tag" trace && > + > + git -C client cat-file -e $(git -C client rev-parse annotated_tag) > +' > + > # Test protocol v2 with 'http://' transport > # > . "$TEST_DIRECTORY"/lib-httpd.sh > -- > 2.17.0.768.g1526ddbba1.dirty > -- Brandon Williams

Re: [PATCH 2/2] fetch: send "refs/tags/" prefix upon CLI refspecs

2018-06-05 Thread Brandon Williams
etch:to_fetch && > + > + grep "fetch> ref-prefix to_fetch" trace && > + grep "fetch> ref-prefix refs/tags/" trace && > + grep "fetch> include-tag" trace && > + > + git -C client cat-file -e $(git -C client rev-parse annotated_tag) > +' > + > # Test protocol v2 with 'http://' transport > # > . "$TEST_DIRECTORY"/lib-httpd.sh > -- > 2.17.0.768.g1526ddbba1.dirty > -- Brandon Williams

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
marker_size = atoi(check->items[1].value); > @@ -398,7 +398,7 @@ int ll_merge_marker_size(const char *path) > > if (!check) > check = attr_check_initl("conflict-marker-size", NULL); > - if (!git_check_attr(path, check) && check->items[0].value) { > + if (!git_check_attr(&the_index, path, check) && check->items[0].value) { > marker_size = atoi(check->items[0].value); > if (marker_size <= 0) > marker_size = DEFAULT_CONFLICT_MARKER_SIZE; > diff --git a/userdiff.c b/userdiff.c > index a69241b25d..e835e78dd5 100644 > --- a/userdiff.c > +++ b/userdiff.c > @@ -278,7 +278,7 @@ struct userdiff_driver *userdiff_find_by_path(const char > *path) > check = attr_check_initl("diff", NULL); > if (!path) > return NULL; > - if (git_check_attr(path, check)) > + if (git_check_attr(&the_index, path, check)) > return NULL; > > if (ATTR_TRUE(check->items[0].value)) > diff --git a/ws.c b/ws.c > index a07caedd5a..5b67b426e7 100644 > --- a/ws.c > +++ b/ws.c > @@ -78,7 +78,7 @@ unsigned whitespace_rule(const char *pathname) > if (!attr_whitespace_rule) > attr_whitespace_rule = attr_check_initl("whitespace", NULL); > > - if (!git_check_attr(pathname, attr_whitespace_rule)) { > + if (!git_check_attr(&the_index, pathname, attr_whitespace_rule)) { > const char *value; > > value = attr_whitespace_rule->items[0].value; > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH v3 15/20] attr: remove index from git_attr_set_direction()

2018-06-06 Thread Brandon Williams
> > if (should_update_submodules() && o->update && !o->dry_run) > load_gitmodules_file(index, NULL); > @@ -421,7 +421,7 @@ static int check_updates(struct unpack_trees_options *o) > stop_progress(&progress); > errs |= finish_delayed_checkout(&state); > if (o->update) > - git_attr_set_direction(GIT_ATTR_CHECKIN, NULL); > + git_attr_set_direction(GIT_ATTR_CHECKIN); > return errs != 0; > } > > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
On 06/06, Duy Nguyen wrote: > On Wed, Jun 6, 2018 at 6:50 PM, Brandon Williams wrote: > > On 06/06, Nguyễn Thái Ngọc Duy wrote: > >> Make the attr API take an index_state instead of assuming the_index in > >> attr code. All call sites are converted blindly to keep the p

Re: [PATCH v3 17/20] cache.c: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
ry *refresh_cache_entry(struct cache_entry *ce, > -unsigned int options) > +struct cache_entry *refresh_index_entry(struct index_state *istate, > + struct cache_entry *ce, > + unsigned int options) > { > - return refresh_cache_ent(&the_index, ce, options, NULL, NULL); > + return refresh_cache_ent(istate, ce, options, NULL, NULL); > } > > > diff --git a/resolve-undo.c b/resolve-undo.c > index 5e4c8c5f75..9c45fe5d1d 100644 > --- a/resolve-undo.c > +++ b/resolve-undo.c > @@ -146,7 +146,7 @@ int unmerge_index_entry_at(struct index_state *istate, > int pos) > struct cache_entry *nce; > if (!ru->mode[i]) > continue; > - nce = make_cache_entry(ru->mode[i], ru->oid[i].hash, > + nce = make_cache_entry(&the_index, ru->mode[i], ru->oid[i].hash, > name, i + 1, 0); > if (matched) > nce->ce_flags |= CE_MATCHED; > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH 2/8] upload-pack: implement ref-in-want

2018-06-06 Thread Brandon Williams
On 06/05, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Jun 05 2018, Brandon Williams wrote: > > > +uploadpack.allowRefInWant:: > > + If this option is set, `upload-pack` will support the `ref-in-want` > > + feature of the protocol version 2 `fetch` command. > >

Re: [PATCH 2/8] upload-pack: implement ref-in-want

2018-06-06 Thread Brandon Williams
On 06/07, Ævar Arnfjörð Bjarmason wrote: > > On Wed, Jun 06 2018, Brandon Williams wrote: > > > On 06/05, Ævar Arnfjörð Bjarmason wrote: > >> > >> On Tue, Jun 05 2018, Brandon Williams wrote: > >> > >> > +uploadpack.allowRefInWant:: >

[PATCH v2 0/8] ref-in-want

2018-06-13 Thread Brandon Williams
Changes in v2: * issuing a want-ref line to a ref which doesn't exist is just ignored. * fixed some typos Brandon Williams (8): test-pkt-line: add unpack-sideband subcommand upload-pack: implement ref-in-want upload-pack: test negotiation with changing repository fetch: refacto

[PATCH v2 2/8] upload-pack: implement ref-in-want

2018-06-13 Thread Brandon Williams
want-ref " parameter. At the conclusion of negotiation, the server will send a list of all of the wanted references (as provided by "want-ref" lines) in addition to the generated packfile. Signed-off-by: Brandon Williams --- Documentation/config.txt| 7 ++ Docum

[PATCH v2 7/8] fetch-pack: put shallow info in output parameter

2018-06-13 Thread Brandon Williams
sometimes generate the ref map twice: once from the list of refs provided by the remote (as is currently done) and potentially once from the new list of refs that the fetch mechanism provides. Signed-off-by: Brandon Williams --- builtin/clone.c | 4 ++-- builtin/fetch.c | 23

[PATCH v2 5/8] fetch: refactor fetch_refs into two functions

2018-06-13 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. Signed-off-by: Brandon Williams --- builtin/fetch.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c

<    1   2   3   4   5   6   7   8   9   10   >