Re: [PATCH 2/2] remote-curl: allow push options

2017-03-22 Thread Brandon Williams
On 03/22, Jonathan Nieder wrote: I agree with most of these changes, I'll make them locally and send out a reroll. > Brandon Williams wrote: > > > --- a/builtin/send-pack.c > > +++ b/builtin/send-pack.c > > @@ -152,6 +152,7 @@ int cmd_send_pack(int argc, const char

[PATCH v2 1/2] send-pack: send push options correctly in stateless-rpc case

2017-03-22 Thread Brandon Williams
nathan Nieder <jrnie...@gmail.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- send-pack.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/send-pack.c b/send-pack.c index d2d2a49a0..66e652f7e 100644 --- a/send-pack.c +++ b/send

Re: [PATCH 2/2] remote-curl: allow push options

2017-03-22 Thread Brandon Williams
On 03/22, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Teach remote-curl to understand push options and to be able to convey > > them across HTTP. > > > > Signed-off-by: Brandon Williams <bmw...@google.com> > > --- &g

[PATCH v3 1/5] grep: fix help text typo

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/grep.c b/builtin/grep.c index 9304c33e7..4694e68f3 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -979,7 +979,7 @@ int cmd_grep(int argc,

[PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
process. Signed-off-by: Brandon Williams <bmw...@google.com> --- cache.h | 1 + git.c | 2 -- setup.c | 7 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index 8c0e64420..7d253a078 100644 --- a/cache.h +++ b/cache.h @@ -410,6 +410,7 @@ static inlin

[PATCH v3 3/5] grep: fix bug when recursing with relative pathspec

2017-03-17 Thread Brandon Williams
child process can correctly interpret the pathspecs provided by the user as well as being able to properly format its output relative to the directory the user invoked the original command from. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/grep.c

[PATCH v3 5/5] ls-files: fix bug when recursing with relative pathspec

2017-03-17 Thread Brandon Williams
child process can correctly interpret the pathspecs provided by the user as well as being able to properly format its output relative to the directory the user invoked the original command from. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 25 +

[PATCH v3 4/5] ls-files: fix typo in variable name

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 1c0f057d0..ca5b48db0 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@

[PATCH v3 0/5] recursing submodules with relative pathspec (grep and ls-files)

2017-03-17 Thread Brandon Williams
Changes in v3: * Added sign-off to the patches where it was missing. * slight tweak to the style and commit msgs of a few patches. * broke up the last patch (for ls-files) into a typo fix followed by fixing the bug itself. This was to make the diff easier to review. Brandon Williams (5

Re: [PATCH v4 08/10] clone: teach --recurse-submodules to optionally take a pathspec

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams <bmw...@google.com> wrote: > > Teach clone --recurse-submodules to optionally take a pathspec argument > > which describes which submodules should be recursively initialized and > &

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > ... I was being cautious with this patch since git didn't currently > > read GIT_PREFIX. > > Ahh, I forgot about that. Processes we spawn do expect GIT_PREFIX > to

Re: [PATCH v4 09/10] submodule--helper init: set submodule..active

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams <bmw...@google.com> wrote: > > When initializing a submodule set the submodule..active config to > > true if the module hasn't already been configured to be active by some > > other

[PATCH 2/2] grep: fix builds with with no thread support

2017-03-17 Thread Brandon Williams
the output function stored in the output field of the "struct grep_opt" object directly, making it behave similarly to both grep_file() and grep_sha1(). Reported-by: Rahul Bedarkar <rahul.bedar...@imgtec.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/g

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Fri, Mar 17, 2017 at 12:08 PM, Brandon Williams <bmw...@google.com> wrote: > > On 03/17, Stefan Beller wrote: > >> > prefix = setup_git_directory_gently_1(nongit_ok); > >> > + env_prefix =

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
t follow, this doesn't have anything to do with super-prefix. > > ok, sounds reasonable to me; though I do not use this feature, > so my judgement is not as good. > > Do we need a test for this behavior? > > Thanks, > Stefan -- Brandon Williams

[PATCH 1/2] grep: set default output method

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- grep.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/grep.c b/grep.c index 0dbdc1d00..56ef0ecbf 100644 --- a/grep.c +++ b/grep.c @@ -12,6 +12,11 @@ static int grep_source_is_binary(struct grep_sour

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
(Wstat: 256 Tests: 10 Failed: 1) Failed test: 10 Non-zero exit status: 1 I didn't take a close look at it but this would seem to indicate that we don't worry to much about systems without pthreads support. Just food for thought. -- Brandon Williams

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
On 03/17, Jeff King wrote: > On Fri, Mar 17, 2017 at 03:42:32PM -0700, Brandon Williams wrote: > > > > > I didn't take a close look at it but this would seem to indicate that we > > > > don't worry to much about systems without pthreads support. Just food > &g

[PATCH v5 03/10] submodule sync: skip work for inactive submodules

2017-03-17 Thread Brandon Williams
Sync does some work determining what URLs should be used for a submodule but then throws this work away if the submodule isn't active. Instead perform the activity check earlier and skip inactive submodule in order to avoid doing unnecessary work. Signed-off-by: Brandon Williams <

[PATCH v5 02/10] submodule status: use submodule--helper is-active

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 136e26a2c..ab233712d 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1010,14 +1010,13 @@ cmd_

[PATCH v5 00/10] decoupling url and submodule interest

2017-03-17 Thread Brandon Williams
Changes in v5: * Add "NEEDSWORK" comments to indicate where attention is needed once per-worktree config is a reality * --no-recurse now works by clearing the string list of paths. * module_list_active() now does post-processing instead of duplicating code. Brandon Wi

Re: [PATCH v4 07/10] submodule init: initialize active submodules

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams <bmw...@google.com> wrote: > > Teach `submodule init` to initialize submodules which have been > > configured to be active by setting 'submodule.active' with a pathspec. > > > > N

[PATCH v5 08/10] clone: teach --recurse-submodules to optionally take a pathspec

2017-03-17 Thread Brandon Williams
'--recurse-submodules' to mean recursing into submodules, so advertise this spelling here as the genuine option. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-clone.txt | 14 ++ builtin/clone.c | 50 - t/t7400-su

[PATCH v5 09/10] submodule--helper init: set submodule..active

2017-03-17 Thread Brandon Williams
When initializing a submodule set the submodule..active config to true if the module hasn't already been configured to be active by some other means (e.g. a pathspec set in submodule.active). Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 12 +

[PATCH v5 05/10] submodule--helper clone: check for configured submodules using helper

2017-03-17 Thread Brandon Williams
Use the 'is_submodule_initialized()' helper to check for configured submodules instead of manually checking for the submodule's URL in the config. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 15 +++ 1 file changed, 3 insertions(

Re: [PATCH] run-command: fix segfault when cleaning forked async process

2017-03-17 Thread Brandon Williams
ut > they don't have a child_process struct, and the cleanup > function ends up dereferencing NULL. > > We should notice this case and assume that the processes do > not need to be waited for (i.e., the same behavior they had > before 46df6906f). > > Reporte

[PATCH v5 04/10] submodule sync: use submodule--helper is-active

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 577136148..db94dea3b 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1089,14 +1089,14 @@ cm

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
On 03/17, Jeff King wrote: > On Fri, Mar 17, 2017 at 11:47:01AM -0700, Brandon Williams wrote: > > > While taking a look at this bug I discovered that the test suite doesn't > > pass 100% of the test when compiled with the NO_PTHREADS option. The > > following

[PATCH v5 06/10] submodule: decouple url and submodule interest

2017-03-17 Thread Brandon Williams
owed by the pathspec check against submodule.active. To ensure backwards compatibility, if neither of these options are set, git falls back to checking the submodule..url option to determine if a submodule is interesting. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documenta

[PATCH v5 01/10] submodule--helper: add is-active subcommand

2017-03-17 Thread Brandon Williams
of the configuration variable in scripts. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c| 11 +++ t/t7413-submodule-is-active.sh | 31 +++ 2 files changed, 42 insertions(+) create mode 100755 t/t7413-submodule-is-activ

[PATCH v5 07/10] submodule init: initialize active submodules

2017-03-17 Thread Brandon Williams
. If no path arguments are given and 'submodule.active' is not configured, then `init` will retain the old behavior of initializing all submodules. This allows users to record more complex patterns as it saves retyping them whenever you invoke update. Signed-off-by: Brandon Williams <bmw...@google.

[PATCH v5 10/10] submodule add: respect submodule.active and submodule..active

2017-03-17 Thread Brandon Williams
In addition to adding submodule..url to the config, set submodule..active to true unless submodule.active is configured and the submodule's path matches the configured pathspec. Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 14 ++ t

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-20 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > I don't think that prefix can ever have ".." in it. From what I > > understand it is always a path from the root of the repository to the > > cwd that the git command wa

Re: [PATCH] submodule.c: fix an 'using integer as NULL pointer' warning

2017-03-15 Thread Brandon Williams
item->string); > } > > - parse_pathspec(, 0, 0, 0, args.argv); > + parse_pathspec(, 0, 0, NULL, args.argv); > ret = match_pathspec(, path, strlen(path), 0, NULL, 1); > > argv_array_clear(); > -- > 2.12.0 -- Brandon Williams

Re: [PATCH v3 10/10] submodule add: respect submodule.active and submodule..active

2017-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > + if git config --get submodule.active >/dev/null > > + then > > + # If the submodule being adding isn't already covered by the > > + # current c

Re: [PATCH v3 09/10] submodule--helper init: set submodule..active

2017-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > When initializing a submodule set the submodule..active config to > > true to indicate that the submodule is active. > > > > Signed-off-by: Brandon Williams <bmw...@goog

[PATCH v2 3/4] grep: fix bug when recursing with relative pathspec

2017-03-14 Thread Brandon Williams
child process can correctly interpret the pathspecs provided by the user as well as being able to properly format its output relative to the directory the user invoked the original command from. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/grep.c

[PATCH v2 4/4] ls-files: fix bug when recursing with relative pathspec

2017-03-14 Thread Brandon Williams
child process can correctly interpret the pathspecs provided by the user as well as being able to properly format its output relative to the directory the user invoked the original command from. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c

Re: [PATCH v3 00/10] decoupling a submodule's existence and its url

2017-03-14 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > changes in v3: > > > > * Droped a patch which tried to use a more accurate URL for deinit. It > > didn't > > really fit inside the scope of this series. It may

[PATCH v2 2/4] setup: allow for prefix to be passed to git commands

2017-03-14 Thread Brandon Williams
In a future patch child processes which act on submodules need a little more context about the original command that was invoked. This patch teaches git to use the prefix stored in `GIT_INTERNAL_TOPLEVEL_PREFIX` if another prefix wasn't found during the git directory setup process. --- cache.h

[PATCH v2 0/4] recursing submodules with relative pathspec (grep and ls-files)

2017-03-14 Thread Brandon Williams
as correctly formatting their output with relative paths. In order to pass the prefix to a child I made a new env var since the existing GIT_PREFIX isn't respected. I'm not sure this is the best method so I'm open to ideas on the best way to convey this information to a child process. Brandon

[PATCH v2 1/4] grep: fix help text typo

2017-03-14 Thread Brandon Williams
--- builtin/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/grep.c b/builtin/grep.c index 9304c33e7..4694e68f3 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -979,7 +979,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)

Re: [PATCH v2 4/4] ls-files: fix bug when recursing with relative pathspec

2017-03-15 Thread Brandon Williams
On 03/14, Stefan Beller wrote: > On Tue, Mar 14, 2017 at 3:11 PM, Brandon Williams <bmw...@google.com> wrote: > > When using the --recurse-submodules flag with a relative pathspec which > > includes "..", an error is produced inside the child process spawned for

Re: [PATCH v3 07/10] clone: add --submodule-spec= switch

2017-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > The new switch passes the pathspec to `git submodule update > > --init-active` which is called after the actual clone is done. > > > > Additionally this configures the submodu

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
.len); > > > > - grep_source_clear(); > > - strbuf_release(); > > + grep_source_clear(); > > + strbuf_release(); > > return hit; > > } > > } Thanks for pointing out the bug (there seem to just be more and more in this grep code...but what else can you expect from my first contribution! :D) but I think it would be better to make the way the recursive code output's more consistent with the way the rest of the grep handles output. That way we can get rid of some of the special casing that I had done here. I'll send out what I have locally in just a second. -- Brandon Williams

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
environment, but instead setting the same value > to GIT_PREFIX and we should get the same behaviour, no? > Very true, potentially we could just use GIT_PREFIX instead of introducing a brand new env var (which is essentially just the same thing). I was being cautious with this patch since git didn't currently read GIT_PREFIX. I was hoping other with more knowledge in this area would voice their opinions and lead me in the right direction ;) -- Brandon Williams

Re: Add configuration options for some commonly used command-line options

2017-03-20 Thread Brandon Williams
e code > could be done in a month), the gsoc student can always convert more > config to the new way. If in the future we did want better support for making user defaults (apart from aliases) for commands we could entertain creating a command like bash's 'command' which ignores any user defaults and executes a particular command in a vanilla mode. So if the user configured 'git am' to always use the -3 option then running `git command am` (or something akin to that) would just run the vanilla 'am' command with no options. Probably not the best idea since tooling would need to become aware of such a paradigm change, but its just a thought. -- Brandon Williams

Re: [PATCH]v2 adding built-in driver for javascript

2017-03-16 Thread Brandon Williams
t; > "JavaScript". > > Yeah thanks, and while at it, the "v2" in the subject should be inside > the square brackets around "PATCH". You can use the --reroll-count option to format-patch to have format patch place the v inside the bracketed PATCH section. -- Brandon Williams

Re: [PATCH v4 03/10] submodule sync: skip work for inactive submodules

2017-03-17 Thread Brandon Williams
On 03/16, Junio C Hamano wrote: > Stefan Beller <sbel...@google.com> writes: > > > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams <bmw...@google.com> wrote: > >> Sync does some work determining what URLs should be used for a submodule > >> but then th

[PATCH v4 08/10] clone: teach --recurse-submodules to optionally take a pathspec

2017-03-16 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-clone.txt | 14 ++ builtin/clone.c | 47 ++- t/t7400-submodule-basic.sh | 68 + 3 files changed, 117 insertions(+), 12 deletion

[PATCH v4 07/10] submodule init: initialize active submodules

2017-03-16 Thread Brandon Williams
. If no path arguments are given and 'submodule.active' is not configured, then `init` will retain the old behavior of initializing all submodules. This allows users to record more complex patterns as it saves retyping them whenever you invoke update. Signed-off-by: Brandon Williams <bmw...@google.

[PATCH v4 05/10] submodule--helper clone: check for configured submodules using helper

2017-03-16 Thread Brandon Williams
Use the 'is_submodule_initialized()' helper to check for configured submodules instead of manually checking for the submodule's URL in the config. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 15 +++ 1 file changed, 3 insertions(

[PATCH v4 00/10] decoupling url and submodule interest

2017-03-16 Thread Brandon Williams
command line options resulting in what I think is less cluttered UI from the last version. See patch 7 and 8 for more detail. * Fixed an incorrect parameter type in patch 6 (thanks Ramsay). Brandon Williams (10): submodule--helper: add is-active subcommand submodule status: use

[PATCH v4 10/10] submodule add: respect submodule.active and submodule..active

2017-03-16 Thread Brandon Williams
In addition to adding submodule..url to the config, set submodule..active to true unless submodule.active is configured and the submodule's path matches the configured pathspec. Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 12 t

[PATCH v4 02/10] submodule status: use submodule--helper is-active

2017-03-16 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 136e26a2c..ab233712d 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1010,14 +1010,13 @@ cmd_

[PATCH v4 04/10] submodule sync: use submodule--helper is-active

2017-03-16 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 577136148..db94dea3b 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1089,14 +1089,14 @@ cm

[PATCH v4 06/10] submodule: decouple url and submodule interest

2017-03-16 Thread Brandon Williams
owed by the pathspec check against submodule.active. To ensure backwards compatibility, if neither of these options are set, git falls back to checking the submodule..url option to determine if a submodule is interesting. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documenta

[PATCH v4 03/10] submodule sync: skip work for inactive submodules

2017-03-16 Thread Brandon Williams
Sync does some work determining what URLs should be used for a submodule but then throws this work away if the submodule isn't active. Instead perform the activity check earlier and skip inactive submodule in order to avoid doing unnecessary work. Signed-off-by: Brandon Williams <

[PATCH v4 09/10] submodule--helper init: set submodule..active

2017-03-16 Thread Brandon Williams
When initializing a submodule set the submodule..active config to true if the module hasn't already been configured to be active by some other means (e.g. a pathspec set in submodule.active). Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 7

[PATCH v4 01/10] submodule--helper: add is-active subcommand

2017-03-16 Thread Brandon Williams
of the configuration variable in scripts. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c| 11 +++ t/t7413-submodule-is-active.sh | 31 +++ 2 files changed, 42 insertions(+) create mode 100755 t/t7413-submodule-is-activ

Re: [PATCH v3 05/10] submodule: decouple url and submodule existence

2017-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Currently the submodule..url config option is used to determine > > if a given submodule exists and is interesting to the user. This > > however doesn't work very well beca

Re: [PATCH v3 06/10] submodule update: add `--init-active` switch

2017-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > +static void module_list_active(struct module_list *list) > > +{ > > + int i; > > + > > + if (read_cache() < 0) > > + die(_(&quo

Re: [PATCH v3 06/10] submodule update: add `--init-active` switch

2017-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > +--init-active:: > > + This option is only valid for the update command. > > + Initialize all submodules configured in "`submodule.active`" > > + that have not

Re: [PATCH v3 03/10] submodule sync: use submodule--helper is-active

2017-03-14 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Signed-off-by: Brandon Williams <bmw...@google.com> > > --- > > git-submodule.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff

Re: [PATCHv9 00/19] Checkout aware of Submodules!

2017-03-14 Thread Brandon Williams
reordered the patches, such that >-> the first two patches are Valerys series and could go on its own as > a cleanup >-> added a new patch "submodule.c: get_super_prefix_or_empty" to > have cleaner code. > * split up the error conditions in the test lib for rea

Re: [PATCH v2 2/4] setup: allow for prefix to be passed to git commands

2017-03-14 Thread Brandon Williams
On 03/14, Johannes Schindelin wrote: > Hi Brandon, > > On Tue, 14 Mar 2017, Brandon Williams wrote: > > > In a future patch child processes which act on submodules need a little > > more context about the original command that was invoked. This patch > > teache

Re: [PATCH v3 01/10] submodule--helper: add is_active command

2017-03-14 Thread Brandon Williams
implementation > detail to do so is by using a new is_active() function, so the patch > title needs a bit of tweaking, too. > > Subject: submodule--helper: add is-active subcommand Thanks for helping wordsmith this. Since starting to contribute I've realized that writing a good commit message is probably the hardest part of the whole process. -- Brandon Williams

Re: [PATCH v3 02/10] submodule status: use submodule--helper is-active

2017-03-14 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Signed-off-by: Brandon Williams <bmw...@google.com> > > --- > > git-submodule.sh | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff

Re: [PATCH v3 02/10] submodule status: use submodule--helper is-active

2017-03-14 Thread Brandon Williams
On 03/14, Brandon Williams wrote: > On 03/14, Junio C Hamano wrote: > > Brandon Williams <bmw...@google.com> writes: > > > > > Signed-off-by: Brandon Williams <bmw...@google.com> > > > --- > > > git-submodule.sh | 3 +-- > > > 1 file

Re: [PATCH v3 04/10] submodule--helper clone: check for configured submodules using helper

2017-03-14 Thread Brandon Williams
On 03/14, Stefan Beller wrote: > On Tue, Mar 14, 2017 at 11:06 AM, Junio C Hamano <gits...@pobox.com> wrote: > > Brandon Williams <bmw...@google.com> writes: > > > >> - /* > >> - * Looking up the url in .git/config. > >> -

Re: [PATCH v2 1/4] grep: fix help text typo

2017-03-14 Thread Brandon Williams
On 03/14, Stefan Beller wrote: > On Tue, Mar 14, 2017 at 3:10 PM, Brandon Williams <bmw...@google.com> wrote: > > Missing SoB here, too. I guess I'm having an off day...Will fix. > > > --- > > builtin/grep.c | 2 +- > > 1 file changed, 1 insertion(

Re: [PATCH v3 05/10] submodule: decouple url and submodule existence

2017-03-15 Thread Brandon Williams
tion > better than what I had back then. > > On Mon, Mar 13, 2017 at 2:43 PM, Brandon Williams <bmw...@google.com> wrote: > > Currently the submodule..url config option is used to determine > > if a given submodule exists and is interesting to the user. This >

Re: [PATCH v4 03/10] submodule sync: skip work for inactive submodules

2017-03-16 Thread Brandon Williams
On 03/16, Stefan Beller wrote: > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams <bmw...@google.com> wrote: > > Sync does some work determining what URLs should be used for a submodule > > but then throws this work away if the submodule isn't active. Instead > >

Re: [RFC] dropping support for ancient versions of curl

2017-04-04 Thread Brandon Williams
On 04/05, Johannes Schindelin wrote: > Hi Brandon, > > On Tue, 4 Apr 2017, Brandon Williams wrote: > > > I'm all for seeing a patch like this applied. I agree that we can't > > expect the world to be running the most up-to-date version of curl but > > we should

Re: [PATCH] grep: plug a trivial memory leak

2017-04-10 Thread Brandon Williams
t cmd_grep(int argc, const char **argv, const char > *prefix) > hit |= wait_all(); > if (hit && show_in_pager) > run_pager(, prefix); > + clear_pathspec(); > free_grep_patterns(); > return !hit; > } > -- > 2.11.0 > -- Brandon Williams

[PATCH 4/5] run-command: prepare child environment before forking

2017-04-10 Thread Brandon Williams
In order to avoid allocation between 'fork()' and 'exec()' prepare the environment to be used in the child process prior to forking. Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 84 --- 1 file chang

[PATCH 1/5] run-command: convert sane_execvp to sane_execvpe

2017-04-10 Thread Brandon Williams
', will be used. Signed-off-by: Brandon Williams <bmw...@google.com> --- cache.h | 3 +-- exec_cmd.c| 2 +- run-command.c | 15 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cache.h b/cache.h index 5c8078291..10d40ecae 100644 --- a/cache.h +++ b/c

[PATCH 3/5] run-command: allocate child_err before forking

2017-04-10 Thread Brandon Williams
In order to avoid allocation between 'fork()' and 'exec()' open the stream used for the child's error handeling prior to forking. Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

[PATCH 5/5] run-command: add note about forking and threading

2017-04-10 Thread Brandon Williams
in a locked state in the resulting process with no hope of it ever being released. Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 8 1 file changed, 8 insertions(+) diff --git a/run-command.c b/run-command.c index 84c63b209..2b3249de4 100644 --- a/run-com

[PATCH 2/5] run-command: prepare argv before forking

2017-04-10 Thread Brandon Williams
In order to avoid allocation between 'fork()' and 'exec()' the argv array used in the exec call is prepared prior to forking the process. Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 34 -- 1 file changed, 16 insertions(+), 18 del

[PATCH 0/5] forking and threading

2017-04-10 Thread Brandon Williams
grep --recurse-submodules', and the standard builds against glibc shouldn't exhibit any of this deadlocking. Brandon Williams (5): run-command: convert sane_execvp to sane_execvpe run-command: prepare argv before forking run-command: allocate child_err before forking run-command: prepare

Re: [PATCH 6/5] run-command: avoid potential dangers in forked child

2017-04-11 Thread Brandon Williams
st use execv(e) since it shouldn't have any calls to malloc in them correct? -- Brandon Williams

Re: [PATCH v3 0/5] propagating push-options, remote and refspec

2017-04-11 Thread Brandon Williams
On 04/11, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > v3 builds upon v2 by adding 3 additional patches to add functionality to > > also > > propagate the remote and refspec down to children process's working to push > > submodule

Re: [PATCH 6/5] run-command: avoid potential dangers in forked child

2017-04-11 Thread Brandon Williams
On 04/11, Eric Wong wrote: > Brandon Williams <bmw...@google.com> wrote: > > On 04/11, Eric Wong wrote: > > > Hi Brandon, this series tickles an old itch of mine, so I > > > started working off of it. I'm only somewhat concerned > > > with the path re

Re: [PATCH 5/5] run-command: add note about forking and threading

2017-04-11 Thread Brandon Williams
think the > ruby-core developers (myself included) have fixed all the > problems with it; even in multi-threaded code which calls malloc. -- Brandon Williams

Re: [PATCH 4/5] run-command: prepare child environment before forking

2017-04-11 Thread Brandon Williams
On 04/10, Jonathan Nieder wrote: > Brandon Williams wrote: > > > In order to avoid allocation between 'fork()' and 'exec()' prepare the > > environment to be used in the child process prior to forking. > > If using something like posix_spawn(), this would be needed

Re: [PATCH 11/12] grep: change the internal PCRE code & header names to be PCRE1

2017-04-11 Thread Brandon Williams
changing the enum name. >From [12/12] it looks like the main purpose of this series is to use a more preferment version of PCRE, if all else is equal it doesn't really make much sense to have both versions to be select-able at runtime. Is there any benefit of being able to do that, that I'm missing? -- Brandon Williams

Re: [PATCH 0/5] forking and threading

2017-04-11 Thread Brandon Williams
On 04/11, Jonathan Nieder wrote: > Brandon Williams wrote: > Jonathan Tan had an idea about how to side-step the issue: what if > "grep" forks an appropriate set of child processes before creating any > threads and then communicates with those children using pipes? > Bec

Re: [PATCH] pathspec: always honor `PATHSPEC_PREFIX_ORIGIN` flag

2017-04-03 Thread Brandon Williams
it reset --hard && > + > + echo base >root.c && > + git add "*.c" && > + git commit -m base && > + > + echo change >root.c && > + mkdir -p subdir && > + git -C subdir add -p "../root.c" <<-\EOF && > + y > + EOF > + > + cat >expect <<-\EOF && > + root.c > + EOF > + git diff --cached --name-only >actual && > + test_cmp expect actual > +' > + > test_expect_success 'add -p does not expand argument lists' ' > git reset --hard && > > -- > 2.12.2 > -- Brandon Williams

Re: [PATCH v2] pathspec: honor `PATHSPEC_PREFIX_ORIGIN` with empty prefix

2017-04-04 Thread Brandon Williams
with at least the string > ":(prefix:0)" and thus avoid the warning. > > Signed-off-by: Patrick Steinhardt <p...@pks.im> > --- > > This is the second version of [1]. It fixes a bug catched by > Brandon when the pathspec is resolved to the empty string and > improves the test a bit to actually catch this issue. This version looks good to me. Thanks for fixing that small issue! -- Brandon Williams

Re: [RFC] dropping support for ancient versions of curl

2017-04-04 Thread Brandon Williams
plied. I agree that we can't expect the world to be running the most up-to-date version of curl but we should be able to select some "oldest" version we will support which can be bumped up every couple of years. I mean, ensuring that you are running with an up-to-date version of curl is really important when it comes to all of the security fixes that have been made in each revision. -- Brandon Williams

Re: [PATCH] push: propagate push-options with --recurse-submodules

2017-03-31 Thread Brandon Williams
On 03/31, Jonathan Nieder wrote: > Hi, > > Brandon Williams wrote: > > > Teach push --recurse-submodules to propagate push-options recursively to > > the pushes performed in the submodules. > > Sounds like a good change. > > [...] > > +++ b/submodule

[PATCH v2 2/2] push: propagate push-options with --recurse-submodules

2017-03-31 Thread Brandon Williams
Teach push --recurse-submodules to propagate push-options recursively to the pushes performed in the submodules. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 13 +++-- submodule.h | 1 + t/t5545-push-options.s

[PATCH v2 1/2] push: unmark a local variable as static

2017-03-31 Thread Brandon Williams
There isn't any obvious reason for the 'struct string_list push_options' and 'struct string_list_item *item' to be marked as static, so unmark them as being static. Also, clear the push_options string_list to prevent memory leaking. Signed-off-by: Brandon Williams <bmw...@google.

[PATCH v2 0/2] propagate push-options

2017-03-31 Thread Brandon Williams
v2 addresses Jonathan's comments as well as adds an additional patch to unmark a local variable as static. Brandon Williams (2): push: unmark a local variable as static push: propagate push-options with --recurse-submodules builtin/push.c | 5 +++-- submodule.c | 13

[PATCH] push: propagate push-options with --recurse-submodules

2017-03-31 Thread Brandon Williams
Teach push --recurse-submodules to propagate push-options recursively to the pushes performed in the submodules. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 14 +++--- submodule.h | 3 ++- t/t5545-push-options.s

Re: [PATCH v2 1/2] push: unmark a local variable as static

2017-03-31 Thread Brandon Williams
On 03/31, Jonathan Nieder wrote: > Brandon Williams wrote: > > > Also, clear the push_options string_list to > > prevent memory leaking. > > That's not a real leak, right? Is the motivation to make it not show up > in valgrind output? well d

Re: [PATCH 1/5] run-command: convert sane_execvp to sane_execvpe

2017-04-12 Thread Brandon Williams
On 04/10, Brandon Williams wrote: > Convert 'sane_execvp()' to 'sane_execvpe()' which optionally takes a > pointer to an array of 'char *' which should be used as the environment > for the process being exec'd. If no environment is provided (by passing > NULL instead) then the alre

Re: [PATCH] ls-files: properly prepare submodule environment

2017-04-12 Thread Brandon Williams
t;sub/file && > + git -C sub add file && > + git -C sub commit -m "add file" && > + > + git init parent && > + mkdir parent/src && > + echo "foobar" >parent/src/file && > + git -C parent add src/file && > + git -C parent submodule add ../sub src/sub && > + git -C parent submodule add ../sub sub && > + git -C parent commit -m "add files and submodules" && > + > + # Verify grep from root works > + cat >expect <<-\EOF && > + .gitmodules > + src/file > + src/sub/file > + sub/file > + EOF > + git -C parent ls-files --recurse-submodules >actual && > + test_cmp expect actual && > + > + # Verify grep from a subdir works > + cat >expect <<-\EOF && > + file > + sub/file > + EOF > + git -C parent/src ls-files --recurse-submodules >actual && > + test_cmp expect actual > +' > + > +test_incompatible_with_recurse_submodules () > +{ > + test_expect_success "--recurse-submodules and $1 are incompatible" " > + test_must_fail git ls-files --recurse-submodules $1 2>actual && > + test_i18ngrep -- '--recurse-submodules unsupported mode' actual > + " > +} > + > +test_incompatible_with_recurse_submodules --deleted > +test_incompatible_with_recurse_submodules --others > +test_incompatible_with_recurse_submodules --unmerged > +test_incompatible_with_recurse_submodules --killed > +test_incompatible_with_recurse_submodules --modified > + > +test_done > -- > 2.12.2.776.gded3dc243c29.dirty > -- Brandon Williams

Re: [PATCH v2 2/2] push: propagate push-options with --recurse-submodules

2017-04-06 Thread Brandon Williams
On 04/05, Jacob Keller wrote: > On Fri, Mar 31, 2017 at 5:19 PM, Jonathan Nieder <jrnie...@gmail.com> wrote: > > Brandon Williams wrote: > > > >> Teach push --recurse-submodules to propagate push-options recursively to > >> the pushes performed in the submodu

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