On Tue, 30 Oct 2018 10:57:09 +0100 (STD)
Johannes Schindelin wrote:
> Hi Antonio,
>
Hi Johannes,
> On Thu, 25 Oct 2018, Antonio Ospite wrote:
>
> > diff --git a/t/t7418-submodule-sparse-gitmodules.sh
> > b/t/t7418-submodule-sparse-gitmodules.sh
> > new file
Tests 5 and 6 check for the effects of the same commit, merge the two
tests to make it more straightforward to clean things up after the test
has finished.
The cleanup will be added in a future commit.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 18 +-
1
eable" command, as git scripts may want to perform the check
before modifying submodules configuration.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 24 +++-
cache.h | 2 ++
submodule.c | 18 ++
s
.
This is because the git API does not always make it possible access the
object store of an arbitrary repository (see get_oid() usage in
config_from_gitmodules()).
When this git limitation gets fixed the aforementioned use case will be
supported too.
Signed-off-by: Antonio Ospite
---
Makefile
dules".
The purpose of the change is mainly to centralize the code that writes
to the .gitmodules file to avoid some duplication.
The naming follows git_config_set_in_file_gently() but the git_ prefix
is removed to communicate that this is not a generic git-config API.
Signed-off-by: Antonio Ospite
---
Use the 'submodule--helper config' command in git-submodules.sh to avoid
referring explicitly to .gitmodules by the hardcoded file path.
This makes it possible to access the submodules configuration in a more
controlled way.
Signed-off-by: Antonio Ospite
---
git-submodule.sh | 8
1
Add a new print_config_from_gitmodules() helper function to print values
from .gitmodules just like "git config -f .gitmodules" would.
This will be used by a new submodule--helper subcommand to be able to
access the .gitmodules file in a more controlled way.
Signed-off-by: Anto
ctually start afresh
in the new scenario.
This is more future-proof and does not break current tests.
Signed-off-by: Antonio Ospite
---
t/t7506-status-submodule.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 94
anymore.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index f2cd1f4a2c..b1f3c6489b 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule
now, instead of just testing the return
value of "git submodule ..." commands when .gitmodules is not in the
working tree, the actual use case is checked in each test, with pre-
and post-conditions.
Thank you,
Antonio
Antonio Ospite (10):
submodule: add a print_c
case where this new feature does not work
properly yet: nested submodules without .gitmodules in their working
tree. This has been documented with a warning and a test_expect_failure
item in t7814, and in this case the current behavior is not altered: no
config is read.
Signed-off-by: Anto
Add a new 'config' subcommand to 'submodule--helper', this extra level
of indirection makes it possible to add some flexibility to how the
submodules configuration is handled.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 14 ++
t/t7411-submodule-config.sh | 27
On Thu, 25 Oct 2018 17:40:47 +0900
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> > this series teaches git to try and read the .gitmodules file from the
> > index (:.gitmodules) or from the current branch (HEAD:.gitmodules) when
> > the file is not readily avail
ty output
'
Maybe a little overkill?
The "upstream" repo will be added in test 1 to better clarify the roles
of the involved repositories.
The commit ids should be stable because of test_tick, shouldn't they?
Thanks for the comments, they helped improving the quality of the t
" or
"--list-all" as possible additions), and does not affect the generated
code, so I though it was worth it.
Anyways, these are really details, let's concentrate on patches 9 and
10 which deserve much more attention. :)
Thanks you,
Antonio
--
Antonio Ospite
https://ao2.it
h
On Fri, 5 Oct 2018 15:05:51 +0200
Antonio Ospite wrote:
[...]
> t/t7416-submodule-sparse-gitmodules.sh | 78 ++
> 16 files changed, 410 insertions(+), 32 deletions(-)
> create mode 100755 t/t7416-submodule-sparse-gitmodules.sh
I just saw that t7416 and t7417 have b
fault enum value but I am not sure what it
should be: NO_COMMAND_OPTION, COMMAND_DEFAULT, MODE_DEFAULT?
Ciao,
Antonio
--
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
> submodule.c
>
> Signed-off-by: Stefan Beller
Not sure if I am entitled to formally ack it, but:
Acked-by: Antonio Ospite
> ---
>
> Antonio Ospite writes:
> > BTW, with Stefan Beller we also identified some unneeded code which
> > could have been remove
case where this new feature does not work
properly yet: nested submodules without .gitmodules in their working
tree. This has been documented with a warning and a test_expect_failure
item in t7814, and in this case the current behavior is not altered: no
config is read.
Signed-off-by: Anto
eable" command, as git scripts may want to perform the check
before modifying submodules configuration.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 24 +++-
cache.h | 2 ++
submodule.c | 18 ++
s
Add a new 'config' subcommand to 'submodule--helper', this extra level
of indirection makes it possible to add some flexibility to how the
submodules configuration is handled.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 14 ++
t/t7411-submodule-config.sh | 27
.
This is because the git API does not always make it possible access the
object store of an arbitrary repository (see get_oid() usage in
config_from_gitmodules()).
When this git limitation gets fixed the aforementioned use case will be
supported too.
Signed-off-by: Antonio Ospite
---
Makefile
dules".
The purpose of the change is mainly to centralize the code that writes
to the .gitmodules file to avoid some duplication.
The naming follows git_config_set_in_file_gently() but the git_ prefix
is removed to communicate that this is not a generic git-config API.
Signed-off-by: Antonio Ospite
---
anymore.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index f2cd1f4a2c..b1f3c6489b 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule
Add a new print_config_from_gitmodules() helper function to print values
from .gitmodules just like "git config -f .gitmodules" would.
This will be used by a new submodule--helper subcommand to be able to
access the .gitmodules file in a more controlled way.
Signed-off-by: Anto
ctually start afresh
in the new scenario.
This is more future-proof and does not break current tests.
Signed-off-by: Antonio Ospite
---
t/t7506-status-submodule.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 94
Use the 'submodule--helper config' command in git-submodules.sh to avoid
referring explicitly to .gitmodules by the hardcoded file path.
This makes it possible to access the submodules configuration in a more
controlled way.
Signed-off-by: Antonio Ospite
---
git-submodule.sh | 8
1
specific.
Thank you,
Antonio
Antonio Ospite (10):
submodule: add a print_config_from_gitmodules() helper
submodule: factor out a config_set_in_gitmodules_file_gently function
t7411: merge tests 5 and 6
t7411: be nicer to future tests and really clean things up
submodule--helpe
Tests 5 and 6 check for the effects of the same commit, merge the two
tests to make it more straightforward to clean things up after the test
has finished.
The cleanup will be added in a future commit.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 18 +-
1
On Thu, 27 Sep 2018 11:00:52 -0700
Stefan Beller wrote:
> On Thu, Sep 27, 2018 at 7:44 AM Antonio Ospite wrote:
[...]
> > OK, so the plan for v6 is:
> >
> > - avoid the corruption issues spotted by Gábor by removing the call
> > to repo_read_gitmodules in buil
On Fri, 21 Sep 2018 09:19:45 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> > Protecting the problematic submodules function could work for now, but
> > I'd like to have more comments, my proposal is:
> >
> > diff --git a/builtin/grep.c b/built
Hi Stefan,
On Mon, 24 Sep 2018 14:00:50 -0700
Stefan Beller wrote:
> On Mon, Sep 24, 2018 at 3:20 AM Antonio Ospite wrote:
>
[...]
> > This is a limitation of the object store in git, there is no equivalent
> > of get_oid() to get the oid from a specific repositor
On Mon, 17 Sep 2018 16:09:32 +0200
Antonio Ospite wrote:
> Add a new print_config_from_gitmodules() helper function to print values
> from .gitmodules just like "git config -f .gitmodules" would.
>
[...]
> +int print_config_from_gitmodules(const char *key)
I am
On Tue, 18 Sep 2018 19:12:57 +0200
SZEDER Gábor wrote:
[...]
> On Mon, Sep 17, 2018 at 04:09:40PM +0200, Antonio Ospite wrote:
> > When the .gitmodules file is not available in the working tree, try
> > using the content from the index and from the current branch.
>
> &qu
is obviously wrong in this
> patch and could be responsible for the memory corruption, but there is
> one thing I found strange, though:
>
>
> On Mon, Sep 17, 2018 at 04:09:40PM +0200, Antonio Ospite wrote:
> > When the .gitmodules file is not available in the working tree, try
>
new' which erroneously slipped in
a commit.
* Update some comments and commit messages.
Thank you,
Antonio
Antonio Ospite (9):
submodule: add a print_config_from_gitmodules() helper
submodule: factor out a config_set_in_gitmodules_file_gently function
t7411: merge tests 5 and 6
t
Add a new print_config_from_gitmodules() helper function to print values
from .gitmodules just like "git config -f .gitmodules" would.
This will be used by a new submodule--helper subcommand to be able to
access the .gitmodules file in a more controlled way.
Signed-off-by: Anto
ctually start afresh
in the new scenario.
This is more future-proof and does not break current tests.
Signed-off-by: Antonio Ospite
---
t/t7506-status-submodule.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 94
Add a new 'config' subcommand to 'submodule--helper', this extra level
of indirection makes it possible to add some flexibility to how the
submodules configuration is handled.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 14 ++
t/t7411-submodule-config.sh | 27
anymore.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index f2cd1f4a2c..b1f3c6489b 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule
ot updated because
config_set_in_gitmodules_file_gently failed).
Finally, add t7416-submodule-sparse-gitmodules.sh to verify that reading
from .gitmodules succeeds and that writing to it fails when the file is
not checked out.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c
dules".
The purpose of the change is mainly to centralize the code that writes
to the .gitmodules file to avoid some duplication.
The naming follows git_config_set_in_file_gently() but the git_ prefix
is removed to communicate that this is not a generic git-config API.
Signed-off-by: Antonio Ospite
---
Tests 5 and 6 check for the effects of the same commit, merge the two
tests to make it more straightforward to clean things up after the test
has finished.
The cleanup will be added in a future commit.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 18 +-
1
eable" command, as git scripts may want to perform the check
before modifying submodules configuration.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 24 +++-
cache.h | 2 ++
submodule.c | 18 ++
s
Use the 'submodule--helper config' command in git-submodules.sh to avoid
referring explicitly to .gitmodules by the hardcoded file path.
This makes it possible to access the submodules configuration in a more
controlled way.
Signed-off-by: Antonio Ospite
---
git-submodule.sh | 8
1
touches suggested by Ævar:
https://public-inbox.org/git/87wosfesxl@evledraar.gmail.com/
Ciao,
Antonio
--
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
On Fri, 24 Aug 2018 18:52:51 +0200
Antonio Ospite wrote:
[...]
> I'll wait for other comments to see if a v5 is really needed.
>
Ping. In case someone missed v4.
Thanks,
Antonio
--
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it
A: Because it messes up the order in which
On Fri, 24 Aug 2018 16:32:38 +0200
Ævar Arnfjörð Bjarmason wrote:
>
> On Fri, Aug 24 2018, Antonio Ospite wrote:
[...]
> > +static int config_print_callback(const char *key_, const char *value_,
> > void *cb_data)
> > +{
> > + char *key = cb_data;
>
Add a new print_config_from_gitmodules() helper function to print values
from .gitmodules just like "git config -f .gitmodules" would.
This will be used by a new submodule--helper subcommand to be able to
access the .gitmodules file in a more controlled way.
Signed-off-by: Anto
ctually start afresh
in the new scenario.
This is more future-proof and does not break current tests.
Signed-off-by: Antonio Ospite
---
t/t7506-status-submodule.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 94
Tests 5 and 6 check for the effects of the same commit, merge the two
tests to make it more straightforward to clean things up after the test
has finished.
The cleanup will be added in a future commit.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 18 +-
1
Add a new 'config' subcommand to 'submodule--helper', this extra level
of indirection makes it possible to add some flexibility to how the
submodules configuration is handled.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 14 ++
t/t7411-submodule-config.sh | 27
neusly slipped in
a commit.
* Update some comments and commit messages.
Thanks,
Antonio
Antonio Ospite (9):
submodule: add a print_config_from_gitmodules() helper
submodule: factor out a config_set_in_gitmodules_file_gently function
t7411: merge tests 5 and 6
t7411: be nicer to future
eable" command, as git scripts may want to perform the check
before modifying submodules configuration.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 24 +++-
cache.h | 2 ++
submodule.c | 18 ++
s
Use the 'submodule--helper config' command in git-submodules.sh to avoid
referring explicitly to .gitmodules by the hardcoded file path.
This makes it possible to access the submodules configuration in a more
controlled way.
Signed-off-by: Antonio Ospite
---
git-submodule.sh | 8
1
dules".
The purpose of the change is mainly to centralize the code that writes
to the .gitmodules file to avoid some duplication.
The naming follows git_config_set_in_file_gently() but the git_ prefix
is removed to communicate that this is not a generic git-config API.
Signed-off-by: Antonio Ospite
---
ot updated because
config_set_in_gitmodules_file_gently failed).
Finally, add t7416-submodule-sparse-gitmodules.sh to verify that reading
from .gitmodules succeeds and that writing to it fails when the file is
not checked out.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c
anymore.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index f2cd1f4a2c..b1f3c6489b 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule
On Wed, 22 Aug 2018 08:29:25 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
[...]
> >> > > + else if (get_oid(GITMODULES_HEAD, ) >= 0)
> >> > > + config_source.blob = GITMODULES_HEAD;
> >> >
> >
On Mon, 20 Aug 2018 23:37:55 +0200
Antonio Ospite wrote:
> On Tue, 14 Aug 2018 13:36:17 -0700
> Junio C Hamano wrote:
>
> > Antonio Ospite writes:
[...]
> > >
> > > + # For more details about this check, see
> > > + # builtin/submodule--help
On Tue, 14 Aug 2018 13:36:17 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> > /* Equivalent to ACTION_SET in builtin/config.c */
> > - if (argc == 3)
> > + if (argc == 3) {
> > + struct object_id oid;
> > +
> > +
On Tue, 14 Aug 2018 10:10:58 -0700
Brandon Williams wrote:
> On 08/14, Antonio Ospite wrote:
> > Add a new 'config' subcommand to 'submodule--helper', this extra level
> > of indirection makes it possible to add some flexibility to how the
> > submodules configuration is han
On Tue, 14 Aug 2018 13:16:38 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
[...]
> > test_expect_success 'error message contains blob reference' '
> > + # Remove the error introduced in the previous test.
> > + # It is not needed in the following tests.
&g
ctually start afresh
in the new scenario.
This is more future-proof and does not break current tests.
Signed-off-by: Antonio Ospite
---
t/t7506-status-submodule.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 94
Add a new print_config_from_gitmodules() helper function to print values
from .gitmodules just like "git config -f .gitmodules" would.
This will be used by a new submodule--helper subcommand to be able to
access the .gitmodules file in a more controlled way.
Signed-off-by: Anto
as they are orthogonal to this series. I will send them as
a standalone series.
* Minor wording fixes here and there.
The series looks a lot cleaner and more to the point, thanks for the
review.
Ciao,
Antonio
Antonio Ospite (7):
submodule: add a print_config_from_gitmodules() helper
su
dules".
The purpose of the change is mainly to centralize the code that writes
to the .gitmodules file to avoid some duplication.
The naming follows git_config_set_in_file_gently() but the git_ prefix
is removed to communicate that this is not a generic git-config API.
Signed-off-by: Antonio Ospite
---
Add a new 'config' subcommand to 'submodule--helper', this extra level
of indirection makes it possible to add some flexibility to how the
submodules configuration is handled.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 14 ++
new | 0
t
Use the 'submodule--helper config' command in git-submodules.sh to avoid
referring explicitly to .gitmodules by the hardcoded file path.
This makes it possible to access the submodules configuration in a more
controlled way.
Signed-off-by: Antonio Ospite
---
git-submodule.sh | 8
1
ed because
config_set_in_gitmodules_file_gently failed).
Finally, add t7416-submodule-sparse-gitmodules.sh to verify that reading
from .gitmodules succeeds and that writing to it fails when the file is
not checked out.
Signed-off-by: Antonio Ospite
---
Maybe the check in config_set_in_gitmodules_f
anymore.
The error introduced in test 5 is also required by test 6, so the two
commits from above are removed respectively in tests 6 and 8.
Signed-off-by: Antonio Ospite
---
t/t7411-submodule-config.sh | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/t/t7411-submodule
a revert be any different?
> The config --unset already fixes the gitmodules file,
> so I think we can rather do
>
> git commit -a -m 'now the .gitmodules file is fixed at HEAD \
> but has a messy history'
>
> But as I have only read up to here, not knowing what the
On Thu, 2 Aug 2018 11:05:02 -0700
Stefan Beller wrote:
> On Thu, Aug 2, 2018 at 6:47 AM Antonio Ospite wrote:
> >
[...]
> > +extern int print_config_from_gitmodules(const char *key);
>
> The only real pushback for this patch I'd have is lack of documentation
> in
On Thu, 2 Aug 2018 13:43:05 -0700
Stefan Beller wrote:
> On Thu, Aug 2, 2018 at 6:47 AM Antonio Ospite wrote:
> >
> > git submodule commands can now access .gitmodules from the current
> > branch even when it's not in the working tree, add some tests for that
> > s
On Mon, 06 Aug 2018 10:38:20 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> >> I also do not see a reason why we want to stop referring to
> >> .gitmodules explicitly by name. We do not hide the fact that
> >> in-tree .gitignore and .git
On Fri, 03 Aug 2018 09:24:14 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> > The rationale behind the change is to close the circle started with 04
> > and 05 and stop referring to .gitmodules explicitly by file path in git
> > commands. The chang
On Thu, 02 Aug 2018 11:57:14 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> > Add a --stage option to the 'submodule--helper config' command so that
> > the .gitmodules file can be staged without referring to it explicitly by
> > its file path.
>
>
> if (argc == 3)
> return ...
>
> die("need 1 or 2 arguments");
>
Hi Jeff,
I like that, I'll see how this plays out after patch 06 which adds
another option, and decide whether to use this style; validating
arguments beforehand may still look a little cleaner.
Thanks for the comment.
Ciao,
Antonio
--
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
On Thu, 2 Aug 2018 14:15:54 -0700
Stefan Beller wrote:
> On Thu, Aug 2, 2018 at 6:47 AM Antonio Ospite wrote:
> >
> > In particular this makes it possible to really clean things up when
> > removing the last submodule with "git rm".
>
> This sentence
On Thu, 2 Aug 2018 13:50:55 -0700
Stefan Beller wrote:
> On Thu, Aug 2, 2018 at 6:47 AM Antonio Ospite wrote:
> >
> > The is_empty_file() function can be generally useful, move it to dir.c
> > and make it public.
> >
> > Signed-off-by: Antonio Ospite
>
Add a new 'config' subcommand to 'submodule--helper', this extra level
of indirection makes it possible to add some flexibility to how the
submodules configuration is handled.
Signed-off-by: Antonio Ospite
---
Note that the tests follow the predominant style in the file: subshell and cd
right
git submodule commands can now access .gitmodules from the current
branch even when it's not in the working tree, add some tests for that
scenario.
Signed-off-by: Antonio Ospite
---
For the test files I used the most used style in other tests, Stefan suggested
to avoid subshells and use "g
rt afresh in the new
scenario.
This is more future-proof and does not break current tests.
Signed-off-by: Antonio Ospite
---
t/t7506-status-submodule.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index b4b74dbe2
The is_empty_file() function can be generally useful, move it to dir.c
and make it public.
Signed-off-by: Antonio Ospite
---
builtin/am.c | 15 ---
dir.c| 16
dir.h| 1 +
3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/builtin/am.c
st they will
complain.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 54 +++--
t/t7411-submodule-config.sh | 35
2 files changed, 87 insertions(+), 2 deletions(-)
diff --git a/builtin/submodule--helper.c b/builtin/submod
Use 'git submodule--helper config --stage' in git-submodule.sh to remove
the last place where the .gitmodules file is mentioned explicitly by its
file path.
Signed-off-by: Antonio Ospite
---
git-submodule.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-submodule.sh b
dules".
The purpose of the change is mainly to centralize the code that writes
to the .gitmodules file to avoid some duplication.
The naming follows git_config_set_in_file_gently() but the git_ prefix
is removed to communicate that this is not a generic git-config API.
Signed-off-by: Antonio Ospite
---
This will be used to print values just like "git config -f .gitmodules"
would.
Signed-off-by: Antonio Ospite
---
submodule-config.c | 25 +
submodule-config.h | 2 ++
2 files changed, 27 insertions(+)
diff --git a/submodule-config.c b/submodule-conf
when appropriate.
* Renamed t7415-submodule-sparse-gitmodules.sh to
t7416-submodule-sparse-gitmodules.sh because t7415 was taken by
t7415-submodule-names.sh
* Made "git mv" and "git rm" work again when .gitmodules does not
exist.
* Remo
Use the 'submodule--helper config' command in git-submodules.sh to avoid
referring explicitly to .gitmodules by the hardcoded file path.
This makes it possible to access the submodules configuration in a more
controlled way.
Signed-off-by: Antonio Ospite
---
Note that there are other instances
of them.
The modified line is in the last test of the file, so this does not
change the current behavior, it only affects future tests.
Signed-off-by: Antonio Ospite
---
Note that test_when_finished is not used here, both to keep the current style
and also because it does not work in sub-shells.
t
at least the 'git submodule' commands
which *read* the gitmodules configuration file without fully populating
the working tree.
Writing to .gitmodules will still require that the file is checked out,
so check for that before calling config_set_in_gitmodules_file_gently.
Signed-off-by: Antonio Ospite
In particular this makes it possible to really clean things up when
removing the last submodule with "git rm".
The rationale is that if git creates .gitmodules when adding the first
submodule it should also remove it when removing the last submodule.
Signed-off-by: Anto
On Tue, 26 Jun 2018 13:15:33 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> > Generlize config_from_gitmodules to accept a repository as an argument.
>
> generalize???
>
Of course I was going to miss a typo in the first word of the commit
message :|
If th
On Tue, 26 Jun 2018 13:11:40 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
> > Add a helper function to make it clearer that retrieving 'fetch'
> > configuration from the .gitmodules file is a special case supported
> > solely for backwar
Now that 'config_from_gitmodules' is not used in the open, it can be
marked as private.
Hopefully this will prevent its usage for retrieving arbitrary
configuration form the '.gitmodules' file.
Signed-off-by: Antonio Ospite
---
submodule-config.c | 8
submodule-config.h | 12
file.
Signed-off-by: Antonio Ospite
---
config.c | 17 -
config.h | 10 --
submodule-config.c | 17 +
submodule-config.h | 11 +++
4 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/config.c b/config.c
index a0a6ae198
to submodules.
The check about the repo's worktree is removed from repo_read_gitmodules
because it's already performed in config_from_gitmodules.
The config_from_gitmodules function is moved up in the file —unchanged—
before its users to avoid a forward declaration.
Signed-off-by: Antonio Ospite
arbitrary configuration in the
repository that any command can retrieve.
Signed-off-by: Antonio Ospite
---
builtin/submodule--helper.c | 8
submodule-config.c | 14 ++
submodule-config.h | 1 +
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git
to communicate better
that .gitmodules is not to be used as a mechanism to store arbitrary
configuration in the repository that any command can retrieve.
Signed-off-by: Antonio Ospite
---
builtin/fetch.c| 15 +--
submodule-config.c | 28
submodule
1 - 100 of 151 matches
Mail list logo