Thread (1 message) 1 message, 1 author, 2016-06-15

Re: builtin command's prefix question

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:56

Junio C Hamano [off-list ref] writes:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help