git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] URL rewrite in .gitmodules

From
Lars Schneider <larsxschneider@gmail.com>
Date
Oct 25, 2015, 15:12 UTC
Message-ID
<F01EF930-9787-44DD-A2E5-F5FBA029D3E7@gmail.com>
In-Reply-To
<xmqqio618mxc.fsf@gitster.mtv.corp.google.com>
On 20 Oct 2015, at 19:33, Junio C Hamano <gitster@pobox.com> wrote:
Show 24 quoted lines
> Lars Schneider <larsxschneider@gmail.com> writes:
> 
>> If not, what do you think about a patch that adds a "url" section
>> similar to the one in git config to a .gitmodules file?
>> 
>> Example:
>> ----------
>> [submodule "git"]
>> 	path = git
>>        url=git://github.com/larsxschneider/git.git
>> 
>> [url "mycompany.com"]
>>        insteadOf = outside.com
>> ----------
> 
> It is unclear to me if you are adding the last two (or three,
> counting the blank before) lines to your company's private fork of
> the opensource project, but if that is the case, then that would
> defeat your earlier desire:
> 
>> ... I also would prefer not to do this as I want to use the
>> very same hashes as defined by the "upstream" ...
> 
> wouldn't it?
The last three lines are added to my companies closed source Git repo. In this example the company repo references git://github.com/larsxschneider/git.git as submodule. This submodule in turn references another submodule with a URL "outside.com". This is the URL I want to rewrite. Do you think this could be useful to others as well?
Show 15 quoted lines
> I do not think this topic is specific to use of submodules.  If you
> want to encourage your engineers to fetch from nearby mirrors you
> maintain, you would want a forest of url.mine.insteadof=theirs for
> the external repositories that matter to you specified by
> everybody's $HOME/.gitconfig, and one way to do so would be to have
> them use the configuration inclusion.  An item in your engineer
> orientation material could tell them to add
> 
> 	[include]
> 		path = /usr/local/etc/git/mycompany.urlrewrite
> 
> when they set up their "[user] name/email" in there.
> 
> And you can update /usr/local/etc/git/mycompany.urlrewrite as
> needed.
Oh nice, I didn't know about "include". However, as mentioned to Stefan in this thread, I fear that our engineers will miss that. I would prefer a solution that does not need any additional setup. Therefore the suggestion to add rewrites in the .gitmodules file.

Thanks, Lars

Previous: Junio C HamanoNext: Stefan Beller
Message 5 of 8 in “[RFC] URL rewrite in .gitmodules”
  1. Lars SchneiderOct 19, 2015
  2. Stefan BellerOct 19, 2015
  3. Lars SchneiderOct 25, 2015
  4. Junio C HamanoOct 20, 2015
  5. Lars SchneiderOct 25, 2015
  6. Stefan BellerOct 26, 2015
  7. Jens LehmannOct 26, 2015
  8. Lars SchneiderNov 15, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.