Re: [BUG] git --work-tree=... status

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [BUG] git --work-tree=... status

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

Uwe Kleine-König  [off-list ref] writes:
The problem seems to be that require_work_tree demands more that I think
it should.  It calls `git rev-parse --is-inside-work-tree`.
I think the semantics of require_work_tree is (currently and has
been) indeed "you are supposed to be inside the work tree".

"git-status $args" is a "git commit --dry-run $args" and $args
are often filenames relative to $cwd that name paths to include
in the partial commit, so for this particular case I think it is
understandable that it wants you to be _IN_ the work tree.

You can propose alternative semantics to "git status" that is
defined as "cd_to_toplevel && git diff --cached && git diff"
that does not care any of the $args, and I personally am open to
such a departure from "commit --dry-run" semantics, which have
been there since 1.4.0 days.  But that is a huge user level
semantics change, and will not belong to the 1.5.X series.

Re: [BUG] git --work-tree=... status

From: Uwe Kleine-König <hidden>
Date: 2016-06-15 22:43:29

Junio C Hamano wrote:
Uwe Kleine-König  [off-list ref] writes:
quoted
The problem seems to be that require_work_tree demands more that I think
it should.  It calls `git rev-parse --is-inside-work-tree`.
I think the semantics of require_work_tree is (currently and has
been) indeed "you are supposed to be inside the work tree".

"git-status $args" is a "git commit --dry-run $args" and $args
are often filenames relative to $cwd that name paths to include
in the partial commit, so for this particular case I think it is
understandable that it wants you to be _IN_ the work tree.
An (IMHO better) alternative is to introduce two flags---say
--absolute-paths and --relative-paths.  --relative-paths is the default
if you're in a work tree, otherwise it's --absolute-paths.

Best regards
Uwe

-- 
Uwe Kleine-König

fib where fib = 0 : 1 : zipWith (+) fib (tail fib)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help