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

2017-03-13 Thread Stefan Beller
On Sat, Mar 11, 2017 at 11:09 PM, Junio C Hamano wrote: > Brandon Williams writes: > >>> diff --git a/submodule.c b/submodule.c >>> index 0b2596e88a..bc5fecf8c5 100644 >>> --- a/submodule.c >>> +++ b/submodule.c >>> @@ -1239,6 +1239,141 @@ int bad_to_remove_submodule(const char *path, >>> unsign

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 writes: > > >> diff --git a/submodule.c b/submodule.c > >> index 0b2596e88a..bc5fecf8c5 100644 > >> --- a/submodule.c > >> +++ b/submodule.c > >> @@ -1239,6 +1239,141 @@ int bad_to_remove_submodule(const char *path, > >> unsigned flags) > >>

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

2017-03-11 Thread Junio C Hamano
Brandon Williams writes: >> diff --git a/submodule.c b/submodule.c >> index 0b2596e88a..bc5fecf8c5 100644 >> --- a/submodule.c >> +++ b/submodule.c >> @@ -1239,6 +1239,141 @@ int bad_to_remove_submodule(const char *path, >> unsigned flags) >> return ret; >> } >> >> +static int submodule_

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

2017-03-09 Thread Brandon Williams
On 03/09, Stefan Beller wrote: > +static void submodule_reset_index(const char *path) > +{ > + struct child_process cp = CHILD_PROCESS_INIT; > + prepare_submodule_repo_env_no_git_dir(&cp.env_array); > + > + cp.git_cmd = 1; > + cp.no_stdin = 1; > + cp.dir = path; > + > + argv

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

2017-03-09 Thread Brandon Williams
On 03/09, Stefan Beller wrote: > +/** > + * Moves a submodule at a given path from a given head to another new head. > + * For edge cases (a submodule coming into existence or removing a submodule) > + * pass NULL for old or new respectively. > + */ > +int submodule_move_head(const char *path, > +

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

2017-03-09 Thread Brandon Williams
On 03/09, Stefan Beller wrote: > In later patches we introduce the options and flag for commands > that modify the working directory, e.g. git-checkout. > > This piece of code will be used universally for > all these working tree modifications as it > * supports dry run to answer the question: >

[PATCH 12/17] update submodules: add submodule_move_head

2017-03-09 Thread Stefan Beller
In later patches we introduce the options and flag for commands that modify the working directory, e.g. git-checkout. This piece of code will be used universally for all these working tree modifications as it * supports dry run to answer the question: "Is it safe to change the submodule to this