Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] git-archive: document CWD effect

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

Possibly related (same subject, not in this thread)

René Scharfe [off-list ref] writes:
But just because there is currently no way (that I know of) to change
the working directory on the remote end that doesn't mean the command
needs to ignore the working directory when operating locally, where it
can be changed easily.
I do not think it has much to do with "working directory".  The
remote one would most often be bare, and especially the public
ones are so.  I think the issue is if I ask a tarball of this
commit without giving any specific parameters, what should
happen.

And I think most people find it natural if you give them the
whole tree no matter where they start from.

You could:

        $ git archive HEAD -- t/howto

to have a narrowed tarball, and even if you make:

	$ cd t/howto
	$ git archive HEAD

to produce the whole tree, the user can still do:

	$ cd t/howto
        $ git archive HEAD -- .

to get the narrowed tree if the command understands the prefix
it receives from git_setup_directory().

So while I understand when you say this is "another input
method", letting people in a deep directory to abbreviate their
cwd with "." would equally a good input method, and probably
better than the current implementation, which leaves people
without a single way to say "I want the whole tree" without
cd'ing up.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help