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

Re: insteadOf and git-request-pull output

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 17, 2018, 14:07 UTC
Message-ID
<xmqq7ehbhk63.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20181117122722.GB4094@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> I suspect it would be less confusing if the rewrite were inverted, like:
>
>   [url "gh:"]
>   rewriteTo = https://github.com
>   rewritePrivate
>
>   [url "git://github.com"]
>   rewriteTo = https://github.com
>
> where the mapping of sections to rewrite rules must be one-to-one, not
> one-to-many (and you can see that the flip side is that we have to
> repeat ourselves).
>
> I hate to introduce two ways of doing the same thing, but maybe it is
> simple enough to explain that url.X.insteadOf=Y is identical to
> url.Y.rewriteTo=X. I do think people have gotten confused by the
> ordering of insteadOf over the years, so this would let them specify it
> in whichever way makes the most sense to them.

I do admit that the current "insteadOf" was too cute a way to configure this feature and I often have to read it aloud twice before convincing myself I got X and Y right. It would have been cleaner if the definition were in the opposite direction, exactly because you can rewrite a single thing into just one way, but we do want to support that many things mapping to the same, and the approach to use "url.Y.rewriteTo=X" does express it better.

Previous: Jeff KingNext: Jeff King
Message 8 of 9 in “insteadOf and git-request-pull output”
  1. Konstantin RyabitsevNov 15, 2018
  2. Ævar Arnfjörð BjarmasonNov 15, 2018
  3. Konstantin RyabitsevNov 15, 2018
  4. Junio C HamanoNov 16, 2018
  5. brian m. carlsonNov 16, 2018
  6. Junio C HamanoNov 17, 2018
  7. Jeff KingNov 17, 2018
  8. Junio C HamanoNov 17, 2018
  9. Jeff KingNov 22, 2018

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.