* [PATCH] submodule: configure submodule.<name>.path on add and init
@ 2012-09-24 19:30 Orgad Shaneh
2012-09-24 19:32 ` Orgad Shaneh
2012-09-24 19:57 ` Jens Lehmann
0 siblings, 2 replies; 6+ messages in thread
From: Orgad Shaneh @ 2012-09-24 19:30 UTC (permalink / raw)
To: git; +Cc: Orgad Shaneh
In order to read diff options for a submodule, its path must be configured
---
git-submodule.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/git-submodule.sh b/git-submodule.sh
index 3e2045e..f97bb62 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
esac
) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
fi
+ git config submodule."$sm_path".path "$sm_path"
git config submodule."$sm_path".url "$realrepo"
git add $force "$sm_path" ||
@@ -476,6 +477,7 @@ cmd_init()
url=$(resolve_relative_url "$url") || exit
;;
esac
+ git config submodule."$name".path "$name" ||
git config submodule."$name".url "$url" ||
die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] submodule: configure submodule.<name>.path on add and init
2012-09-24 19:30 [PATCH] submodule: configure submodule.<name>.path on add and init Orgad Shaneh
@ 2012-09-24 19:32 ` Orgad Shaneh
2012-09-24 19:57 ` Jens Lehmann
1 sibling, 0 replies; 6+ messages in thread
From: Orgad Shaneh @ 2012-09-24 19:32 UTC (permalink / raw)
To: git; +Cc: Orgad Shaneh
On Mon, Sep 24, 2012 at 9:30 PM, Orgad Shaneh <orgads@gmail.com> wrote:
> In order to read diff options for a submodule, its path must be configured
> ---
> git-submodule.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 3e2045e..f97bb62 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
> esac
> ) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
> fi
> + git config submodule."$sm_path".path "$sm_path"
> git config submodule."$sm_path".url "$realrepo"
>
> git add $force "$sm_path" ||
> @@ -476,6 +477,7 @@ cmd_init()
> url=$(resolve_relative_url "$url") || exit
> ;;
> esac
> + git config submodule."$name".path "$name" ||
> git config submodule."$name".url "$url" ||
> die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
>
> --
> 1.7.10.4
>
Oops, || should have been &&
- Orgad
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] submodule: configure submodule.<name>.path on add and init
2012-09-24 19:30 [PATCH] submodule: configure submodule.<name>.path on add and init Orgad Shaneh
2012-09-24 19:32 ` Orgad Shaneh
@ 2012-09-24 19:57 ` Jens Lehmann
2012-09-24 20:43 ` Junio C Hamano
1 sibling, 1 reply; 6+ messages in thread
From: Jens Lehmann @ 2012-09-24 19:57 UTC (permalink / raw)
To: Orgad Shaneh; +Cc: git
Am 24.09.2012 21:30, schrieb Orgad Shaneh:
> In order to read diff options for a submodule, its path must be configured
> ---
> git-submodule.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 3e2045e..f97bb62 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
> esac
> ) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
> fi
> + git config submodule."$sm_path".path "$sm_path"
> git config submodule."$sm_path".url "$realrepo"
>
> git add $force "$sm_path" ||
> @@ -476,6 +477,7 @@ cmd_init()
> url=$(resolve_relative_url "$url") || exit
> ;;
> esac
> + git config submodule."$name".path "$name" ||
> git config submodule."$name".url "$url" ||
> die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
Nack. The path must only be configured in .gitmodules or we'll
never be able to rename the submodule directory.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] submodule: configure submodule.<name>.path on add and init
2012-09-24 19:57 ` Jens Lehmann
@ 2012-09-24 20:43 ` Junio C Hamano
2012-09-25 20:58 ` Jens Lehmann
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2012-09-24 20:43 UTC (permalink / raw)
To: Jens Lehmann; +Cc: Orgad Shaneh, git
Jens Lehmann <Jens.Lehmann@web.de> writes:
> Am 24.09.2012 21:30, schrieb Orgad Shaneh:
>> In order to read diff options for a submodule, its path must be configured
>> ---
>> git-submodule.sh | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/git-submodule.sh b/git-submodule.sh
>> index 3e2045e..f97bb62 100755
>> --- a/git-submodule.sh
>> +++ b/git-submodule.sh
>> @@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
>> esac
>> ) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
>> fi
>> + git config submodule."$sm_path".path "$sm_path"
>> git config submodule."$sm_path".url "$realrepo"
>>
>> git add $force "$sm_path" ||
>> @@ -476,6 +477,7 @@ cmd_init()
>> url=$(resolve_relative_url "$url") || exit
>> ;;
>> esac
>> + git config submodule."$name".path "$name" ||
>> git config submodule."$name".url "$url" ||
>> die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
>
> Nack. The path must only be configured in .gitmodules or we'll
> never be able to rename the submodule directory.
That sounds sensible on the surface, and the rejection of this is
probably the right thing to do, but then how would the name/path
mapping work without .gitmodules? Historically, you did not have to
have a .gitmodules in-tree at all in order to use submodules
locally, but if discovery of submodule.$name.ignore depends on
having the in-tree .gitmodules file, that sounds like a minor
regression to me.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] submodule: configure submodule.<name>.path on add and init
2012-09-24 20:43 ` Junio C Hamano
@ 2012-09-25 20:58 ` Jens Lehmann
0 siblings, 0 replies; 6+ messages in thread
From: Jens Lehmann @ 2012-09-25 20:58 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Orgad Shaneh, git
Am 24.09.2012 22:43, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
>
>> Am 24.09.2012 21:30, schrieb Orgad Shaneh:
>>> In order to read diff options for a submodule, its path must be configured
>>> ---
>>> git-submodule.sh | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/git-submodule.sh b/git-submodule.sh
>>> index 3e2045e..f97bb62 100755
>>> --- a/git-submodule.sh
>>> +++ b/git-submodule.sh
>>> @@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
>>> esac
>>> ) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
>>> fi
>>> + git config submodule."$sm_path".path "$sm_path"
>>> git config submodule."$sm_path".url "$realrepo"
>>>
>>> git add $force "$sm_path" ||
>>> @@ -476,6 +477,7 @@ cmd_init()
>>> url=$(resolve_relative_url "$url") || exit
>>> ;;
>>> esac
>>> + git config submodule."$name".path "$name" ||
>>> git config submodule."$name".url "$url" ||
>>> die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
>>
>> Nack. The path must only be configured in .gitmodules or we'll
>> never be able to rename the submodule directory.
>
> That sounds sensible on the surface, and the rejection of this is
> probably the right thing to do, but then how would the name/path
> mapping work without .gitmodules? Historically, you did not have to
> have a .gitmodules in-tree at all in order to use submodules
> locally, but if discovery of submodule.$name.ignore depends on
> having the in-tree .gitmodules file, that sounds like a minor
> regression to me.
AFAIK the name/path mapping was added to enable moving submodules
around in the work tree without having to adapt its $GITDIR/config
entries every time you checkout a commit where the submodule's work
tree is moved someplace else inside the superproject's work tree.
Nowadays we also use that to consistently store the submodule's
.git directory under "modules/<name>" inside the superproject's
.git directory no matter what its current path is.
You still don't need a .gitmodules file to use submodules locally,
but then moving around these submodules is not - and has never
been - that easy. To use the ignore setting without a .gitmodules
file you'll just have to set both submodule.$name.ignore and
submodule.$name.path (to provide the mapping, in most cases path
and name will simply be the same) in your $GITDIR/config and
everything will work just fine.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] submodule: configure submodule.<name>.path on add and init
@ 2012-09-24 19:32 Orgad Shaneh
0 siblings, 0 replies; 6+ messages in thread
From: Orgad Shaneh @ 2012-09-24 19:32 UTC (permalink / raw)
To: git; +Cc: Orgad Shaneh
In order to read diff options for a submodule, its path must be configured
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
git-submodule.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/git-submodule.sh b/git-submodule.sh
index 3e2045e..af9c003 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
esac
) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
fi
+ git config submodule."$sm_path".path "$sm_path"
git config submodule."$sm_path".url "$realrepo"
git add $force "$sm_path" ||
@@ -476,6 +477,7 @@ cmd_init()
url=$(resolve_relative_url "$url") || exit
;;
esac
+ git config submodule."$name".path "$name" &&
git config submodule."$name".url "$url" ||
die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-09-25 20:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 19:30 [PATCH] submodule: configure submodule.<name>.path on add and init Orgad Shaneh
2012-09-24 19:32 ` Orgad Shaneh
2012-09-24 19:57 ` Jens Lehmann
2012-09-24 20:43 ` Junio C Hamano
2012-09-25 20:58 ` Jens Lehmann
-- strict thread matches above, loose matches on Subject: below --
2012-09-24 19:32 Orgad Shaneh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).