Re: [PATCH 3/3] t5403: do not use access repos with GIT_DIR when worktree is involved

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> writes:

> Setting GIT_DIR alone means worktree is current directory for legacy
> reasons. Avoid using that, instead go to the worktree and execute
> commands there.
>
> The troublesome command is "GIT_DIR=clone2/.git git add clone2/b". The
> real worktree is clone2, but that command tells git worktree is $(pwd).
> What does user expect to add then? Should the new entry in index be "b"
> or "clone2/b"?

There is no troublesomeness here, as the semantics has been clearly
defined and (hopefully) stayed constant before the days when GIT_WORK_TREE
was invented.

Assuming that there is no core.worktree in clone2/.git/config and there is
no GIT_WORK_TREE environment variable, "GIT_DIR=$anything git add
clone2/b" should add a path "clone2/b" to the index controlled by that
$GIT_DIR no matter where $anything is.

I would like to find out the motivation behind this patch. Even though I
find the ancient style stale and unsightly, we would want to keep the
(GIT_DIR is set, GIT_WORK_TREE is not set anywhere) combination working
for people who have work habits (read: old scripts) that rely on it. So we
would discourage new tests from using ancient style, but at the same time,
we would not want to remove _all_ existing ones.

Unless we are trying to break them without knowing, and declare that we
deprecated it after the fact, which is not exactly the way we want to
remove existing (mis)feature.

Same comment applies to the other patch that removes the test that uses
update-index && update-ref combination to a lessor degree.

The [PATCH 2/3] is a genuine improvement, though.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]