threads / discuss / 35185

Working patterns

Subject: Working patterns

## tl;dr

2 messages between Oct 23, 2013 and Oct 23, 2013.

replies: 1people: 2as markdown or json

Dale R. Worley· Oct 23, 2013, 20:23 UTC · lore
Show 11 quoted lines
> The pattern I use is to have this:
> 
>         /repository/.git
> 		with core.worktree = /working
>         /working/...
> 
> then
> 
>         cd /repository
>         git add /working/x/y
>         git ...

The point I'm trying to make is that it appears that all of the Git commands implemented as programs use the same code at the beginning to determine the location of the Git repository and the root directory of the work tree -- to determine GIT_DIR and GIT_WORK_TREE effectively. And the code works with my work pattern, which seems intuitively correct to me.

It seems to me that this code should implement the design, and the design should match what the code does.

However, the parallel code in the Git commands that are scripts, which seems to be in git-sh-setup, does not implement the same design as the C code does.

It seems to me that the two sets of Git commands should be invokable under the same circumstances, that there is a design specification as to how Git can be invoked, and both implementations should match that.

Dale
Junio C Hamano· Oct 23, 2013, 21:44 UTC · re: Dale R. Worley · lore

Re: Working patterns

worley@alum.mit.edu (Dale R. Worley) writes:
> It seems to me that the two sets of Git commands should be invokable
> under the same circumstances, that there is a design specification as
> to how Git can be invoked, and both implementations should match that.

As far as I know, the design for any (be it script or command) is that they should be able to run from the top-level and from any subdirectory within, but running from outside the top-level of the working tree has never been part of the design goal. If some commands tolerated it, that was by mere accident and not by design.

← back to recent threads