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

Re: [PATCH] worktree: add per-worktree config files

From
Duy Nguyen <pclouds@gmail.com>
Date
Sep 29, 2018, 06:36 UTC
Message-ID
<CACsJy8DKG3dh-TxzdJPUJxZRMuV8+UpYoSTp7hyk8koZ0+Raeg@mail.gmail.com>
In-Reply-To
<87r2heiybu.fsf@evledraar.gmail.com>

On Thu, Sep 27, 2018 at 8:34 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 33 quoted lines
> I see I'm misremembering most of the details here. I thought that if I put:
>
>     [remote "whatever]
>     url = ...
>
> Into my ~/.gitconfig that it wouldn't work, but it does, e.g. here in my
> ~/g/git:
>
>     $ grep -A1 whatever .git/config
>     $
>     $ grep -A1 whatever ~/.gitconfig
>     [remote "whatever"]
>         url = git@github.com:test/git.git
>
> But there's still some special casing for .git/config going on,
> e.g. here:
>
>     $ git config remote.origin.url
>     git@github.com:git/git.git
>     $ git config remote.whatever.url
>     git@github.com:test/git.git
>     $ git remote get-url origin
>     git@github.com:git/git.git
>     $ git remote get-url whatever
>     fatal: No such remote 'whatever'
>
> And:
>
>     $ git remote set-url whatever git@github.com:test2/git.git
>     fatal: No such remote 'whatever'
>
> So there is some special casing of .git/config somewhere. I looked into
> this ages ago, and don't remember where that's done.

To conclude this thread. Yes some code does know about where the config variable is from and it looks like only "git remote" and "git upload-pack" takes advantage of it [1] [2].

I considered documentation improvement for the git-remote part, but I don't see anywhere I can fit "some remote attributes can be shared from ~/.gitconfig, but a remote can only be added from repo-level config" in. Jeff already documented it well. I found one minor problem there in the documentation, which I will send separately.

Thanks again for making me aware of this.

[1] e459b073fb (remote rename: more carefully determine whether a remote is configured - 2017-01-19) [2] 20b20a22f8 (upload-pack: provide a hook for running pack-objects - 2016-05-18)

-- 
Duy
Previous: Duy NguyenNext: Nguyễn Thái Ngọc Duy
Message 15 of 34 in “worktree: add per-worktree config files”
  1. worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Sep 23, 2018
  2. Eric SunshineSep 23, 2018
  3. Taylor BlauSep 24, 2018
  4. Duy NguyenSep 25, 2018
  5. Duy NguyenSep 29, 2018
  6. Junio C HamanoSep 25, 2018
  7. Duy NguyenSep 26, 2018
  8. Junio C HamanoSep 26, 2018
  9. Wherefor worktrees?Marc Branchaud, Sep 27, 2018
  10. Duy NguyenSep 27, 2018
  11. Ævar Arnfjörð BjarmasonSep 26, 2018
  12. Duy NguyenSep 27, 2018
  13. Ævar Arnfjörð BjarmasonSep 27, 2018
  14. Duy NguyenSep 27, 2018
  15. Duy NguyenSep 29, 2018
  16. 0/2 Per-worktree config filesNguyễn Thái Ngọc Duy, Sep 29, 2018
  17. 1/2 t1300: extract and use test_cmp_config()Nguyễn Thái Ngọc Duy, Sep 29, 2018
  18. Eric SunshineSep 30, 2018
  19. SZEDER GáborSep 30, 2018
  20. 2/2 worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Sep 29, 2018
  21. Eric SunshineSep 30, 2018
  22. Duy NguyenSep 30, 2018
  23. Eric SunshineSep 30, 2018
  24. Duy NguyenSep 30, 2018
  25. 0/2 Per-worktree config filesNguyễn Thái Ngọc Duy, Oct 2, 2018
  26. 1/2 t1300: extract and use test_cmp_config()Nguyễn Thái Ngọc Duy, Oct 2, 2018
  27. Eric SunshineOct 3, 2018
  28. 2/2 worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Oct 2, 2018
  29. 0/2 Per-worktree config filesNguyễn Thái Ngọc Duy, Oct 21, 2018
  30. 1/2 t1300: extract and use test_cmp_config()Nguyễn Thái Ngọc Duy, Oct 21, 2018
  31. 2/2 worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Oct 21, 2018
  32. Junio C HamanoOct 22, 2018
  33. Duy NguyenOct 22, 2018
  34. Junio C HamanoOct 25, 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.