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
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
uot;.
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 +
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 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
ually 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
ind
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
418: 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 pr
one rare 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-of
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-subm
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
/submodule/file2 &&
git -C super status --short >output &&
test_must_be_empty 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 stabl
e "--stage" 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
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 been
default 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?
ules outside of
> 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
ually 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
ind
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 +
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-subm
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
uot;.
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
one rare 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-of
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
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--
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/
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 th
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
I didn't notice anything that 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 avail
est.
* Remove a stale file named '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_fil
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
ually 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
ind
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-subm
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 +
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
ules was not 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--help
uot;.
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
a v5 with some minor
cosmetic 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 w
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
ually 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
ind
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-subm
move a stale file named 'new' which erroneusly 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
t741
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 +
uot;.
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
ules was not 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--help
On Wed, 22 Aug 2018 08:29:25 -0700
Junio C Hamano wrote:
> Antonio Ospite writes:
>
[...]
> >> > > + else if (get_oid(GITMODULES_HEAD, &oid) >= 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
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 foll
ually 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
ind
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
uot;.
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
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 +
not 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
---
Maybe the check in config_set_in_gitmod
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
re could be.
Would 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 re
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
> >
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 .gitattr
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 change is not
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 is a
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: s
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 &q
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
es not exist 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/buil
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-subm
y 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 b4b7
uot;.
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
existence 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.
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
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
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: Anto
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 backward compati
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
sub
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
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: Anto
a mechanism to store 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 dele
dules, in the effort 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 +++
1 - 100 of 151 matches
Mail list logo