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

Re: builtin command's prefix question

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 5, 2007, 23:43 UTC
Message-ID
<7v8x48lnce.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<7vk5nsloa8.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 20 quoted lines
> I am not convinced this is giving any natural user experience, nor an
> alternative:
>
>       $ cd $HOME
>       $ GIT_WORK_TREE=$HOME; export GIT_WORK_TREE
>       $ cd $HOME/gits/vimrc.git
>       $ edit $HOME/.vimrc
>       $ git commit .vimrc
>       $ cd $HOME/gits/pinerc.git
>       $ edit $HOME/.pinerc
>       $ git commit .pinerc
>
> While I still think the combination is simply crazy and does not make
> any sense, if enough users on the list agrees that it makes sense, I
> wouldn't mind setup() did (1) to (3) mentioned above.  The alternative
> is simply to declare GIT_WORK_TREE without GIT_DIR is a nonsense and
> either error error out or ignore GIT_WORK_TREE, which might be easier to
> explain to people.
>
> Opinions?
Side note.

By saying the above, I do not mean it is nonsense to try supporting a work tree that is an overlay of disjoint set of work tree files from multiple repositories/projects. I do think it is a worthwhile goal to support such a layout.

What I do not like is the way the ugly workaround does it, by encouraging (rather, requiring) to issue git commands from a location that is completely separate from the actual editing of the content happens.

An independent issue of supporting such a overlayed work tree layout is what to do with .gitignore files. I think, especially with the recent addition of --exclude-standard to ls-files and setup_standard_excludes() in dir.c, we could have a per repository configuration that names the per repository exclude files, so that .gitignore-vim and .gitignore-pine can co-exist in $HOME, each excluding everything other than the project's own files.

Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 4 of 7 in “builtin command's prefix question”
  1. Nguyen Thai Ngoc DuyDec 5, 2007
  2. Junio C HamanoDec 5, 2007
  3. Junio C HamanoDec 5, 2007
  4. Junio C HamanoDec 5, 2007
  5. Nguyen Thai Ngoc DuyDec 6, 2007
  6. Johannes SchindelinDec 6, 2007
  7. Junio C HamanoDec 6, 2007

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.