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

2017-04-05 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 v3 1/5] push: unmark a local variable as static

2017-04-05 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 v3 4/5] submodule--helper: add push-check subcommand

2017-04-05 Thread Brandon Williams
Add the 'push-check' subcommand to submodule--helper which is used to check if the provided remote and refspec can be used as part of a push operation in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.

[PATCH v3 3/5] remote: expose parse_push_refspec function

2017-04-05 Thread Brandon Williams
A future patch needs access to the 'parse_push_refspec()' function so let's export the function so other modules can use it. Signed-off-by: Brandon Williams <bmw...@google.com> --- remote.c | 2 +- remote.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/remote.c b/re

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

2017-04-05 Thread Brandon Williams
] and [2/5] remain unchanged from v2. Brandon Williams (5): push: unmark a local variable as static push: propagate push-options with --recurse-submodules remote: expose parse_push_refspec function submodule--helper: add push-check subcommand push: propagate remote and refspec with --recurse

[PATCH v3 5/5] push: propagate remote and refspec with --recurse-submodules

2017-04-05 Thread Brandon Williams
urse-submodules" with a path or URL as remote will not propagate the remote or refspec and instead use the default remote and refspec configured in the submodule, preserving the current behavior. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule

[PATCH v2 2/6] run-command: prepare command before forking

2017-04-13 Thread Brandon Williams
the path resolution it performs. Instead we simply do the path resolution ourselves during the preparation stage prior to forking. Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 60 +++ 1 file changed, 40 inse

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

2017-04-13 Thread Brandon Williams
-Signal-Safe functions in the child process. Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 9 + 1 file changed, 9 insertions(+) diff --git a/run-command.c b/run-command.c index 4230c4933..1c36e692d 100644 --- a/run-command.c +++ b/run-command.c @@ -525,6 +

[PATCH v2 3/6] run-command: prepare child environment before forking

2017-04-13 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. Switch to using 'execve()' so that the construct child environment can used in the exec'd process. Signed-off-by: Brandon Williams <bmw...@google.com> --

Re: [PATCH v2 1/2] ls-files: fix recurse-submodules with nested submodules

2017-04-13 Thread Brandon Williams
rate on, that would be bring in the abstractions that we'd need. Agreed, though we're probably pretty far from that becoming a reality. One day though! -- Brandon Williams

Re: [PATCH 2/4] submodule.c: uninitialized submodules are ignored in recursive commands

2017-04-13 Thread Brandon Williams
On 04/13, Stefan Beller wrote: > On Thu, Apr 13, 2017 at 12:05 PM, Brandon Williams <bmw...@google.com> wrote: > > On 04/11, Stefan Beller wrote: > >> This was an oversight when working on the working tree modifying commands > >> recursing into submodules. &g

Re: [PATCH 2/4] submodule.c: uninitialized submodules are ignored in recursive commands

2017-04-13 Thread Brandon Williams
odules submodule.sub1.ignore all && > git config submodule.sub1.ignore all && > git add .gitmodules && > -- > 2.12.2.603.g7b28dc31ba > -- Brandon Williams

[PATCH v2 0/6] forking and threading

2017-04-13 Thread Brandon Williams
ext should work without deadlock and we could potentially move to using vfork instead of fork, though I'll let others more experienced make that decision. Brandon Williams (6): t5550: use write_script to generate post-update hook run-command: prepare command before forking run-command: prepare ch

[PATCH 3/2] ls-files: only recurse on active submodules

2017-04-13 Thread Brandon Williams
Add in a check to see if a submodule is active before attempting to recurse. This prevents 'ls-files' from trying to operate on a submodule which may not exist in the working directory. Signed-off-by: Brandon Williams <bmw...@google.com> --- After you mentioned possibly needing to

Re: [PATCH 3/4] submodule.c: harden submodule_move_head against broken submodules

2017-04-13 Thread Brandon Williams
hing/ignore it, in the future we may want to actually clone and then check it out. -- Brandon Williams

Re: [PATCH v2 4/6] run-command: don't die in child when duping /dev/null

2017-04-13 Thread Brandon Williams
On 04/13, Eric Wong wrote: > Brandon Williams <bmw...@google.com> wrote: > > @@ -487,7 +483,7 @@ int start_command(struct child_process *cmd) > > atexit(notify_parent); > > > > if (cmd->no_stdin) > > - dup_devnul

Re: [PATCH v5 02/11] t0061: run_command executes scripts without a #! line

2017-04-20 Thread Brandon Williams
On 04/20, Johannes Schindelin wrote: > Hi Brandon, > > On Thu, 20 Apr 2017, Brandon Williams wrote: > > > On 04/20, Johannes Schindelin wrote: > > > > > > On Wed, 19 Apr 2017, Brandon Williams wrote: > > > > > > > On 04/19, Johannes Sixt

Re: [PATCH 1/2] submodule.c: add has_submodules to check if we have any submodules

2017-04-20 Thread Brandon Williams
t a/submodule.h b/submodule.h > index 8a8bc49dc9..5ec72fbb16 100644 > --- a/submodule.h > +++ b/submodule.h > @@ -1,6 +1,12 @@ > #ifndef SUBMODULE_H > #define SUBMODULE_H > > +#define SUBMODULE_CHECK_ANY_CONFIG (1<<0) > +#define SUBMODULE_CHECK_ABSORBED_GIT_DIRS(1<<1) > +#define SUBMODULE_CHECK_GITMODULES_IN_WT (1<<2) > +#define SUBMODULE_CHECK_GITLINKS_IN_TREE (1<<3) > +int has_submodules(unsigned what_to_check); -- Brandon Williams

Re: [PATCHv2 0/4] recursive submodules: git-reset!

2017-04-20 Thread Brandon Williams
| 30 ++ > entry.c| 8 > submodule.c| 31 +++ > t/lib-submodule-update.sh | 24 +--- > t/t7112-reset-submodule.sh | 8 ++++ > unpack-trees.c | 7 ++- > 6 files changed, 96 insertions(+), 12 deletions(-) > > -- Brandon Williams

Re: [PATCH v3 01/18] grep: amend submodule recursion test in preparation for rx engine testing

2017-04-20 Thread Brandon Williams
-07). The pattern "(.|.)[\d]" will match this content > differently under fixed/basic/extended & perl. > > Signed-off-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com> Looks good. -- Brandon Williams

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Brandon Williams
On 04/20, Brandon Williams wrote: > On 04/20, Johannes Schindelin wrote: > > Hi Lars & Junio, > > > > On Thu, 20 Apr 2017, Lars Schneider wrote: > > > > > > * bw/forking-and-threading (2017-04-19) 11 commits > > > > - run-command: block sig

Re: [PATCH 1/2] submodule.c: add has_submodules to check if we have any submodules

2017-04-20 Thread Brandon Williams
On 04/20, Stefan Beller wrote: > On Thu, Apr 20, 2017 at 3:07 PM, Brandon Williams <bmw...@google.com> wrote: > > On 04/11, Stefan Beller wrote: > >> +int has_submodules(unsigned what_to_check) > >> +{ > >> + if (

Re: [PATCH v3 03/18] grep: submodule-related case statements should die if new fields are added

2017-04-20 Thread Brandon Williams
pattern != NULL; > @@ -515,6 +517,8 @@ static void compile_submodule_options(const struct > grep_opt *opt, > case GREP_PATTERN_BODY: > case GREP_PATTERN_HEAD: > break; > + default: > + die("BUG: Added a new grep token type without updating > case statement"); > } > } > > -- > 2.11.0 > -- Brandon Williams

Re: [PATCH 2/2] clone: remember references for submodules even when not recursing

2017-04-20 Thread Brandon Williams
eep the references around even if the user doesn't want to recurse immediately? -- Brandon Williams

Re: [PATCH v2 0/6] forking and threading

2017-04-13 Thread Brandon Williams
On 04/13, Jonathan Nieder wrote: > Brandon Williams wrote: > > > From what I can see, there are now no calls in the child process (after fork > > and before exec/_exit) which are not Async-Signal-Safe. This means that > > fork/exec in a threaded context should work witho

Re: [PATCH v2 1/6] t5550: use write_script to generate post-update hook

2017-04-13 Thread Brandon Williams
On 04/13, Eric Wong wrote: > Jonathan Nieder <jrnie...@gmail.com> wrote: > > Brandon Williams wrote: > > > The post-update hooks created in t5550-http-fetch-dumb.sh is missing the > > > "!#/bin/sh" line which can cause issues with portability. Instead &g

Re: [PATCH] submodule--helper: fix typo in is_active error message

2017-04-13 Thread Brandon Williams
if (argc != 2) > - die("submodule--helper is-active takes exactly 1 arguments"); > + die("submodule--helper is-active takes exactly 1 argument"); Obvious fix. Thanks! > > gitmodules_config(); > > -- > 2.12.2.603.g7b28dc31ba > -- Brandon Williams

Re: [PATCH v2 2/6] run-command: prepare command before forking

2017-04-13 Thread Brandon Williams
On 04/13, Jonathan Nieder wrote: > Hi, > > Brandon Williams wrote: > > > In order to avoid allocation between 'fork()' and 'exec()' the argv > > array used in the exec call is prepared prior to forking the process. > > nit: s/(the argv array.*) is prepared/prepare

Re: [PATCH 7/6] run-command: block signals between fork and execve

2017-04-13 Thread Brandon Williams
On 04/13, Eric Wong wrote: > Brandon Williams <bmw...@google.com> wrote: > > v2 does a bit of restructuring based on comments from reviewers. I took the > > patch by Eric and broke it up and tweaked it a bit to flow better with v2. > > I > > left out the part

[PATCH v2 5/6] run-command: eliminate calls to error handling functions in child

2017-04-13 Thread Brandon Williams
reporting happens from the parent; even avoiding functions like atexit(3) and exit(3). Helped-by: Eric Wong <e...@80x24.org> Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 121 ++ 1 file changed, 89 inser

[PATCH v2 1/6] t5550: use write_script to generate post-update hook

2017-04-13 Thread Brandon Williams
The post-update hooks created in t5550-http-fetch-dumb.sh is missing the "!#/bin/sh" line which can cause issues with portability. Instead create the hook using the 'write_script' function which includes the proper "#!" line. Signed-off-by: Brandon Williams <bmw...@google

[PATCH v2 4/6] run-command: don't die in child when duping /dev/null

2017-04-13 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/run-command.c b/run-command.c index 5e2a03145..6751b8319 100644 --- a/run-command.c +++ b/run-command.c @@ -117,18

Re: [PATCH v2 1/2] ls-files: fix recurse-submodules with nested submodules

2017-04-13 Thread Brandon Williams
-recurse-submodules.sh > index 4cf6ccf5a8ea..c8030dd3299a 100755 > --- a/t/t3007-ls-files-recurse-submodules.sh > +++ b/t/t3007-ls-files-recurse-submodules.sh > @@ -77,6 +77,7 @@ test_expect_success 'ls-files recurses more than 1 level' ' > git -C submodule/subsub commit -m "add d" && > git -C submodule submodule add ./subsub && > git -C submodule commit -m "added subsub" && > + git submodule absorbgitdirs && > git ls-files --recurse-submodules >actual && > test_cmp expect actual > ' > -- > 2.12.2.776.gded3dc243c29.dirty > -- Brandon Williams

Re: [PATCH v2 2/2] ls-files: fix path used when recursing into submodules

2017-04-13 Thread Brandon Williams
e a > subdirectory? It seems to work for me but I'm not sure...) Additionally, > it felt weird that there's no helper function for creating a toplevel > relative path. I never considered the case where you use --git-dir or --work-tree, definitely an oversight on my part. This change seems reasonable to me. -- Brandon Williams

Re: [PATCH 7/6] run-command: block signals between fork and execve

2017-04-13 Thread Brandon Williams
break; > + case CHILD_ERR_SIGPROCMASK: > + error_errno("sigprocmask failed restoring signals"); missing a break statement here I'll add it in, in the re-roll. > case CHILD_ERR_ENOENT: > error_errno("cannot run %s", cmd->argv[0]); > break; -- Brandon Williams

Re: [PATCH v5 02/11] t0061: run_command executes scripts without a #! line

2017-04-19 Thread Brandon Williams
On 04/19, Johannes Sixt wrote: > Am 19.04.2017 um 07:43 schrieb Johannes Sixt: > >Am 19.04.2017 um 01:17 schrieb Brandon Williams: > >>Add a test to 't0061-run-command.sh' to ensure that run_command can > >>continue to execute scripts which don't include a '#!' line. &

Re: [PATCH v6 02/11] t0061: run_command executes scripts without a #! line

2017-04-20 Thread Brandon Williams
On 04/20, Johannes Schindelin wrote: > Hi Brandon, > > On Wed, 19 Apr 2017, Brandon Williams wrote: > > > Add a test to 't0061-run-command.sh' to ensure that run_command can > > continue to execute scripts which don't include a '#!' line. > > > >

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Brandon Williams
seem to have made it to `pu` yet) has the > !MINGW prerequisite which should fix the issue. Hopefully my suggested > addition to the commit message will make it into the commit history, too. Thanks for catching this. And as you pointed out the latest reroll should fix the issue. > > Ciao, > Dscho -- Brandon Williams

Re: [PATCH v5 02/11] t0061: run_command executes scripts without a #! line

2017-04-20 Thread Brandon Williams
On 04/20, Johannes Schindelin wrote: > Hi Brandon, > > On Wed, 19 Apr 2017, Brandon Williams wrote: > > > On 04/19, Johannes Sixt wrote: > > > Am 19.04.2017 um 07:43 schrieb Johannes Sixt: > > > >Am 19.04.2017 um 01:17 schrieb Brandon Williams: >

Re: [PATCH v5 11/11] run-command: block signals between fork and execve

2017-04-19 Thread Brandon Williams
On 04/19, Eric Wong wrote: > Johannes Sixt <j...@kdbg.org> wrote: > > Am 19.04.2017 um 01:18 schrieb Brandon Williams: > > >@@ -400,6 +404,53 @@ static char **prep_childenv(const char *const > > >*deltaenv) > > > } > > > #endif > >

[PATCH v6 10/11] run-command: add note about forking and threading

2017-04-19 Thread Brandon Williams
-Signal-Safe functions in the child process. Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 9 + 1 file changed, 9 insertions(+) diff --git a/run-command.c b/run-command.c index 615b6e9c9..df1edd963 100644 --- a/run-command.c +++ b/run-command.c @@ -537,6 +

[PATCH v6 11/11] run-command: block signals between fork and execve

2017-04-19 Thread Brandon Williams
reset the rest to defaults. Similarly, disable pthread cancellation to future-proof our code in case we start using cancellation; as cancellation is implemented with signals in glibc. Signed-off-by: Eric Wong <e...@80x24.org> Signed-off-by: Brandon Williams <bmw...@google.com> ---

[PATCH v6 08/11] run-command: eliminate calls to error handling functions in child

2017-04-19 Thread Brandon Williams
reporting happens from the parent; even avoiding functions like atexit(3) and exit(3). Helped-by: Eric Wong <e...@80x24.org> Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 121 ++ 1 file changed, 89 inser

[PATCH v6 09/11] run-command: handle dup2 and close errors in child

2017-04-19 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 58 ++ 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/run-command.c b/run-command.c index 1f15714b1..615b6e9c9 100644 --- a/run-command.c +++

[PATCH v6 04/11] run-command: use the async-signal-safe execv instead of execvp

2017-04-19 Thread Brandon Williams
it with the 'sh' utility. To maintain this functionality, if 'execv()' fails with ENOEXEC, start_command will atempt to execute the command by interpreting it with 'sh'. [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/exec.html Signed-off-by: Brandon Williams <bmw...@google.

[PATCH v6 05/11] string-list: add string_list_remove function

2017-04-19 Thread Brandon Williams
Teach string-list to be able to remove a string from a sorted 'struct string_list'. Signed-off-by: Brandon Williams <bmw...@google.com> --- string-list.c | 18 ++ string-list.h | 7 +++ 2 files changed, 25 insertions(+) diff --git a/string-list.c b/string-list.c

[PATCH v6 07/11] run-command: don't die in child when duping /dev/null

2017-04-19 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/run-command.c b/run-command.c index 15e2e74a7..b3a35dd82 100644 --- a/run-command.c +++ b/run-command.c @@ -117,18

[PATCH v6 03/11] run-command: prepare command before forking

2017-04-19 Thread Brandon Williams
://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html Signed-off-by: Brandon Williams <bmw...@google.com> --- run-command.c | 46 ++ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/run-command.c b/run-command.c index 574

[PATCH v6 02/11] t0061: run_command executes scripts without a #! line

2017-04-19 Thread Brandon Williams
Add a test to 't0061-run-command.sh' to ensure that run_command can continue to execute scripts which don't include a '#!' line. Signed-off-by: Brandon Williams <bmw...@google.com> --- t/t0061-run-command.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t0061-run-comm

[PATCH v6 01/11] t5550: use write_script to generate post-update hook

2017-04-19 Thread Brandon Williams
The post-update hooks created in t5550-http-fetch-dumb.sh is missing the "!#/bin/sh" line which can cause issues with portability. Instead create the hook using the 'write_script' function which includes the proper "#!" line. Signed-off-by: Brandon Williams <bmw...@google

[PATCH v6 00/11] forking and threading

2017-04-19 Thread Brandon Williams
Changes in v6: * fix some windows compat issues * better comment on the string_list_remove function (also marked extern) Brandon Williams (10): t5550: use write_script to generate post-update hook t0061: run_command executes scripts without a #! line run-command: prepare command before

[PATCH v6 06/11] run-command: prepare child environment before forking

2017-04-19 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. Switch to using 'execve()' so that the construct child environment can used in the exec'd process. Signed-off-by: Brandon Williams <bmw...@google.com> --

Re: [PATCH v2 07/11] submodule update: add `--init-active` switch

2017-03-09 Thread Brandon Williams
On 03/08, Stefan Beller wrote: > On Wed, Mar 8, 2017 at 5:23 PM, Brandon Williams <bmw...@google.com> wrote: > > The new switch `--init-active` initializes the submodules which are > > configured in `submodule.active` instead of those given as > > command lin

Re: [PATCH v2 03/11] submodule deinit: use most reliable url

2017-03-09 Thread Brandon Williams
On 03/08, Stefan Beller wrote: > On Wed, Mar 8, 2017 at 5:23 PM, Brandon Williams <bmw...@google.com> wrote: > > The user could have configured the submodule to have a different URL > > from the one in the superproject's config. To account for this read > > what t

Re: [PATCH v2 10/11] submodule--helper init: set submodule..active

2017-03-09 Thread Brandon Williams
On 03/08, Stefan Beller wrote: > On Wed, Mar 8, 2017 at 5:23 PM, Brandon Williams <bmw...@google.com> wrote: > > When initializing a submodule set the submodule..active config to > > true to indicate that the submodule is active. > > So by this patch an init o

Re: [PATCH v3 2/2] submodule--helper.c: remove duplicate code

2017-03-09 Thread Brandon Williams
On 03/09, Valery Tolstov wrote: > Remove code fragment from module_clone that duplicates functionality > of connect_work_tree_and_git_dir in dir.c > > Signed-off-by: Valery Tolstov <m...@vtolstov.org> Looks good. -- Brandon Williams

Re: [PATCH v2 0/2] Remove duplicate code from module_clone()

2017-03-09 Thread Brandon Williams
or current format (patch and dependency) > is acceptalbe? What you did here should be fine. I was just pointing that out for future series that you send out to the list. -- Brandon Williams

[PATCH 2/2] pathspec: allow escaped query values

2017-03-09 Thread Brandon Williams
attr value. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- pathspec.c | 52 ++ t/t6135-pathspec-with-attrs.sh | 9 2 files changed, 57 insertions(+), 4 de

[PATCH 0/2] bringing attributes to pathspecs

2017-03-09 Thread Brandon Williams
to perform various operations only on that set of files. One simple example: git ls-files -- ":(attr:text)" can be used to list all of the files with the 'text' attribute. Brandon Williams (2): pathspec: allow querying for attributes pathspec: allow escaped query values Doc

[PATCH 1/2] pathspec: allow querying for attributes

2017-03-09 Thread Brandon Williams
e.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/glossary-content.txt | 20 attr.c | 17 attr.h | 1 + dir.c | 43 - pathspec.c

Re: Git attributes are read from head branch instead of given branch when using git archive

2017-03-09 Thread Brandon Williams
re you referring to the server's HEAD? When testing this locally (with a relative URL) I can't seem to reproduce what you are describing. If you could provide a way to reproduce this I would be able to more easily diagnose the problem. -- Brandon Williams

Re: [GSoC] Git patch flow

2017-03-09 Thread Brandon Williams
ooking" email to the list. If you search the archive you'll find many such emails. In the "What's cooking" email you can see if your patch has been picked up by the maintainer and what the status of the patch is (if it needs more discussion, if it has been moved to next, or graduated to master, etc.) -- Brandon Williams

Re: [PATCH 12/17] update submodules: add submodule_move_head

2017-03-09 Thread Brandon Williams
gt; + > static int find_first_merges(struct object_array *result, const char *path, > struct commit *a, struct commit *b) > { > diff --git a/submodule.h b/submodule.h > index 6f3fe85c7c..4cdf6445f7 100644 > --- a/submodule.h > +++ b/submodule.h > @@ -96,6 +96,13 @@ extern int push_unpushed_submodules(struct sha1_array > *commits, > extern void connect_work_tree_and_git_dir(const char *work_tree, const char > *git_dir); > extern int parallel_submodules(void); > > +#define SUBMODULE_MOVE_HEAD_DRY_RUN (1<<0) > +#define SUBMODULE_MOVE_HEAD_FORCE (1<<1) > +extern int submodule_move_head(const char *path, > +const char *old, > +const char *new, > +unsigned flags); > + > /* > * Prepare the "env_array" parameter of a "struct child_process" for > executing > * a submodule by clearing any repo-specific envirionment variables, but > -- > 2.12.0.rc1.45.g207f5fbb2b > -- Brandon Williams

Re: [PATCH 07/17] connect_work_tree_and_git_dir: safely create leading directories

2017-03-09 Thread Brandon Williams
if (safe_create_leading_directories_const(new_git_dir) < 0) > - die(_("could not create directory '%s'"), new_git_dir); > - real_new_git_dir = real_pathdup(new_git_dir); > - connect_work_tree_and_git_dir(path, real_new_git_dir); > - > - free(real_new_git_dir); > + connect_work_tree_and_git_dir(path, > + git_path("modules/%s", sub->name)); > } else { > /* Is it already absorbed into the superprojects git dir? */ > char *real_sub_git_dir = real_pathdup(sub_git_dir); > -- > 2.12.0.rc1.45.g207f5fbb2b > -- Brandon Williams

Re: [PATCH 12/17] update submodules: add submodule_move_head

2017-03-09 Thread Brandon Williams
sure the index is clean as well */ > + submodule_reset_index(path); > + } > + } > + > + prepare_submodule_repo_env_no_git_dir(_array); > + > + cp.git_cmd = 1; > + cp.no_stdin = 1; > + cp.dir = path; > + > + argv_array_pushf(, "--super-prefix=%s/", path); Missed this one too. Same question as the other spot. -- Brandon Williams

Re: [PATCH 12/17] update submodules: add submodule_move_head

2017-03-09 Thread Brandon Williams
ld. Just looking for some clarification. > + argv_array_pushl(, "read-tree", "-u", "--reset", NULL); > + > + argv_array_push(, EMPTY_TREE_SHA1_HEX); > + > + if (run_command()) > + die("could not reset submodule index"); > +} > + -- Brandon Williams

Re: [PATCH 3/5] grep: fix bug when recuring with relative pathspec

2017-03-02 Thread Brandon Williams
On 02/28, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > /* Add super prefix */ > > + quote_path_relative(name, opt->prefix, ); > > Hmph, do you want a quoted version here, not just relative_path()? > > Perhaps add a tes

[PATCH v2 10/11] submodule--helper init: set submodule..active

2017-03-08 Thread Brandon Williams
When initializing a submodule set the submodule..active config to true to indicate that the submodule is active. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/submodule--helper.c b/b

[PATCH v2 08/11] clone: add --submodule-spec= switch

2017-03-08 Thread Brandon Williams
with the pathspec. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-clone.txt | 23 ++- builtin/clone.c | 36 +-- t/t7400-submodule-ba

[PATCH v2 02/11] submodule status: use submodule--helper is-active

2017-03-08 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 554bd1c49..19660b9c0 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1000,14 +1000,13 @@ cmd_

[PATCH v2 03/11] submodule deinit: use most reliable url

2017-03-08 Thread Brandon Williams
The user could have configured the submodule to have a different URL from the one in the superproject's config. To account for this read what the submodule has configured for remote.origin.url and use that instead. Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.

[PATCH v2 05/11] submodule--helper clone: check for configured submodules using helper

2017-03-08 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 v2 2/2] submodule--helper.c: remove duplicate code

2017-03-08 Thread Brandon Williams
LL; > int quiet = 0; > int progress = 0; > - FILE *submodule_dot_git; > char *p, *path = NULL, *sm_gitdir; > struct strbuf rel_path = STRBUF_INIT; rel_path is no longer used so it and the call to strbuf_release() to free its memory can be removed. -- Brandon Williams

Re: Crash on MSYS2 with GIT_WORK_TREE

2017-03-08 Thread Brandon Williams
y work on remembering to do that for the future! -- Brandon Williams

Re: [PATCH 2/2] Fix callsites of real_pathdup() that wanted it to die on error

2017-03-08 Thread Brandon Williams
char *real_path = real_pathdup(ceil); > + char *real_path = real_pathdup_gently(ceil); > if (!real_path) { > return 0; > } > diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh > index 046d9b7909..b06210ec5e 100755 > --- a/t/t1501-work-tree.sh > +++ b/t/t1501-work-tree.sh > @@ -423,7 +423,7 @@ test_expect_success '$GIT_WORK_TREE overrides > $GIT_DIR/common' ' > ) > ' > > -test_expect_failure 'error out gracefully on invalid $GIT_WORK_TREE' ' > +test_expect_success 'error out gracefully on invalid $GIT_WORK_TREE' ' > ( > GIT_WORK_TREE=/.invalid/work/tree && > export GIT_WORK_TREE && > -- > 2.12.0 > -- Brandon Williams

[PATCH v2 04/11] submodule sync: use submodule--helper is-active

2017-03-08 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 1c2064cc1..7ed1aaba3 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1101,7 +1101,7 @@ cm

[PATCH v2 06/11] submodule: decouple url and submodule existence

2017-03-08 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/config.txt | 15 ++-- submodule.c| 36 --- t/t7413-submodule-is-active.sh | 55 ++ 3 files changed, 100 insertions(+), 6 de

[PATCH v2 09/11] completion: clone can initialize specific submodules

2017-03-08 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 6721ff80f..4e473aa90 100644 --- a/contrib/completi

[PATCH v2 01/11] submodule--helper: add is_active command

2017-03-08 Thread Brandon Williams
There are a lot of places where an explicit check for submodule."".url is done to see if a submodule exists. In order to centralize this check introduce a helper which can be used to query if a submodule is active or not. Signed-off-by: Brandon Williams <bmw...@google.com> --- b

[PATCH v2 07/11] submodule update: add `--init-active` switch

2017-03-08 Thread Brandon Williams
by git submodule update --init --init-active This new switch allows users to record more complex patterns as it saves retyping them whenever you invoke update. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Docum

[PATCH v2 11/11] submodule add: respect submodule.active and submodule..active

2017-03-08 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 v2 00/11] decoupling a submodule's existence and its url

2017-03-08 Thread Brandon Williams
in submodule.active Brandon Williams (11): submodule--helper: add is_active command submodule status: use submodule--helper is-active submodule deinit: use most reliable url submodule sync: use submodule--helper is-active submodule--helper clone: check for configured submodules using helper submodule

Re: [PATCH 12/17] update submodules: add submodule_move_head

2017-03-13 Thread Brandon Williams
On 03/11, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > >> diff --git a/submodule.c b/submodule.c > >> index 0b2596e88a..bc5fecf8c5 100644 > >> --- a/submodule.c > >> +++ b/submodule.c > >> @@ -1239,6

Re: [PATCH 2/2] pathspec: allow escaped query values

2017-03-10 Thread Brandon Williams
On 03/09, Jonathan Tan wrote: > On 03/09/2017 01:07 PM, Brandon Williams wrote: > >diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh > >index b5e5a0607..585d17bad 100755 > >--- a/t/t6135-pathspec-with-attrs.sh > >+++ b/t/t6135-pathspec-with-at

[PATCH v2 1/2] pathspec: allow querying for attributes

2017-03-10 Thread Brandon Williams
e.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/glossary-content.txt | 21 + attr.c | 17 attr.h | 1 + dir.c | 43 - pathspec.c

[PATCH v2 2/2] pathspec: allow escaped query values

2017-03-10 Thread Brandon Williams
attr value. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- pathspec.c | 52 ++ t/t6135-pathspec-with-attrs.sh | 19 +++ 2 files changed, 67 insertions(+)

[PATCH v2 0/2] bringing attributes to pathspecs

2017-03-10 Thread Brandon Williams
v2 addresses the comments made by Jonathan. Brandon Williams (2): pathspec: allow querying for attributes pathspec: allow escaped query values Documentation/glossary-content.txt | 21 attr.c | 17 attr.h | 1 + dir.c

Re: [PATCH 1/2] pathspec: allow querying for attributes

2017-03-10 Thread Brandon Williams
On 03/09, Jonathan Tan wrote: > On 03/09/2017 01:07 PM, Brandon Williams wrote: > >diff --git a/Documentation/glossary-content.txt > >b/Documentation/glossary-content.txt > >index fc9320e59..5c32d1905 100644 > >--- a/Documentation/glossary-content.txt > >+++ b/D

Re: [PATCH 02/10] pack-objects: add --partial-by-size=n --partial-special

2017-03-10 Thread Brandon Williams
nce things like .gitattributes can effect things like checkout. > > A while back when we discussed whether to allow symlinks for > .gitattributes, etc, I think the consensus was to treat the whole > ".git*" namespace consistently. I haven't followed up with patches yet, > but my plan was to go that route. Well if I remember correctly you sent out some patches for .gitattributes but I got in the way with the refactoring work! :) -- Brandon Williams

Re: [PATCH v2 1/2] pathspec: allow querying for attributes

2017-03-10 Thread Brandon Williams
On 03/10, Jonathan Tan wrote: > Thanks - I don't think I have any more comments on this patch set > after these. > > On 03/10/2017 10:59 AM, Brandon Williams wrote: > >diff --git a/pathspec.c b/pathspec.c > >index b961f00c8..7cd5f6e3d 100644 > >--- a/pathspec.c &

Re: [PATCH v3 0/2] bringing attributes to pathspecs

2017-03-13 Thread Brandon Williams
On 03/13, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > v3 fixes some nits in style in the test script (using <<-\EOF instead of > > <<-EOF) > > as well as fixing a few other minor things reported by Junio and Jonathan

[PATCH v3 1/2] pathspec: allow querying for attributes

2017-03-13 Thread Brandon Williams
e.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/glossary-content.txt | 21 + attr.c | 17 attr.h | 1 + dir.c | 43 - pathspec.c

[PATCH v3 2/2] pathspec: allow escaped query values

2017-03-13 Thread Brandon Williams
attr value. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- pathspec.c | 52 ++ t/t6135-pathspec-with-attrs.sh | 19 +++ 2 files changed, 67 insertions(+)

[PATCH v3 0/2] bringing attributes to pathspecs

2017-03-13 Thread Brandon Williams
v3 fixes some nits in style in the test script (using <<-\EOF instead of <<-EOF) as well as fixing a few other minor things reported by Junio and Jonathan. Brandon Williams (2): pathspec: allow querying for attributes pathspec: allow escaped query values Documentation/glossary

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Brandon Williams
flag set) and that the entire test suite passes with no errors; this is to maintain bisect-ability. Only after you've done this should you send your patches to the mailing list. -- Brandon Williams

Re: [PATCH v2 0/2] Remove duplicate code from module_clone()

2017-03-08 Thread Brandon Williams
ir.c | 32 +--- > submodule.c | 11 ++- > 3 files changed, 25 insertions(+), 38 deletions(-) > > -- > 2.12.0.192.gbdb9d28a5 > -- Brandon Williams

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

2017-03-13 Thread Brandon Williams
' (either via 'submodule.active' or 'submodule..active') go through the initialization phase and have their relevent info copied over to the config. Brandon Williams (10): submodule--helper: add is_active command submodule status: use submodule--helper is-active submodule sync: use submodule

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

2017-03-13 Thread Brandon Williams
There are a lot of places where an explicit check for submodule."".url is done to see if a submodule exists. In order to centralize this check introduce a helper which can be used to query if a submodule is active or not. Signed-off-by: Brandon Williams <bmw...@google.com> --- b

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

2017-03-13 Thread Brandon Williams
When initializing a submodule set the submodule..active config to true to indicate that the submodule is active. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/submodule--helper.c b/b

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

2017-03-13 Thread Brandon Williams
what the user means by git submodule update --init --init-active This new switch allows users to record more complex patterns as it saves retyping them whenever you invoke update. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@g

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