git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git --work-tree=... status
@ 2007-08-12 18:58 Uwe Kleine-König
  2007-08-12 19:32 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2007-08-12 18:58 UTC (permalink / raw)
  To: git

Hello,

I don't have time now to look into it, so for now as usual just a
report.  If nobody takes it, I will do it later.

	zeisberg@cassiopeia:~/gsrc/git$ git version
	git version 1.5.3.rc4.887.gd56871c

[That's Junio's next + my doc change "checkout-index doc: use --work-dir in
the export example"]

	zeisberg@cassiopeia:~/gsrc/git$ mkdir export

	zeisberg@cassiopeia:~/gsrc/git$ git --work-tree=export checkout-index -a

	zeisberg@cassiopeia:~/gsrc/git$ git --work-tree=export status
	fatal: /home/zeisberg/usr/bin/git-status cannot be used without a working tree.

runstatus works as expected (at least after some thought):

	zeisberg@cassiopeia:~/gsrc/git$ git --work-tree=export runstatus | head
	# On branch next
	# Changed but not updated:
	#   (use "git add <file>..." to update what will be committed)
	#
	#       modified:   .gitignore
	#       modified:   .mailmap
	#       modified:   COPYING
	#       modified:   Documentation/.gitignore
	#       modified:   Documentation/Makefile
	#       modified:   Documentation/RelNotes-1.5.0.1.txt

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`.

Best regards
Uwe

-- 
Uwe Kleine-König

http://www.google.com/search?q=1+newton+in+kg*m+%2F+s%5E2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] git --work-tree=... status
  2007-08-12 18:58 [BUG] git --work-tree=... status Uwe Kleine-König
@ 2007-08-12 19:32 ` Junio C Hamano
  2007-08-17 11:50   ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-08-12 19:32 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: git

Uwe Kleine-König  <ukleinek@informatik.uni-freiburg.de> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] git --work-tree=... status
  2007-08-12 19:32 ` Junio C Hamano
@ 2007-08-17 11:50   ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2007-08-17 11:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano wrote:
> Uwe Kleine-König  <ukleinek@informatik.uni-freiburg.de> 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.
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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-17 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-12 18:58 [BUG] git --work-tree=... status Uwe Kleine-König
2007-08-12 19:32 ` Junio C Hamano
2007-08-17 11:50   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).