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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andy Parkins <andyparkins@...>
Cc: <git@...>, Junio C Hamano <junkio@...>, Nick Williams <njw@...>
Date: Tuesday, April 10, 2007 - 10:24 am

Andy Parkins schrieb:

It works in bare repositories, as does git-ls-tree.  There the question
of what to do in subdirectories doesn't even come up, because there are
none. :)

But just because it works in situations where there are no
subdirectories that doesn't mean that it has to ignore them in other
situations.


'git-archive --remote' passes the options to the remote system, ignoring
the local working directory.  What matters in this case is the working
directory on the remote end, which is the repository's root.

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.


OK, I haven't seen other tools, so I can't really comment on them.
git-archive _does_ work without a checkout, though.


Yes, that's true; git-archive will tell you that your current working
directory is untracked in that case.  (git-ls-tree in that case lists:
nothing.)  But if you want to create a full archive you need to be in
the repository's root directory anyway, so this is no new issue.

What it comes down to is the decision between consistency with third
party export tools or with its (implementation-wise) brother
git-ls-tree, between the convenience of not needing to care where in the
repository you are or the convenience of being able to let the working
directory determine the file set that ends up in the archive.

I'd rather keep it consistent from a technical, implementation point of
view and not care too much about other export tools, and I like my
working directory to influence which files I'm working with.  Working
directory sensitivity is just another input method, like parameters and
environment variables.  I still see no benefit in removing it.  But
perhaps I'm in a rut, unable to see the difficulties with this way to work.

Re(not getting it ;-)né
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
bug in git-archive?, Nick Williams, (Sat Mar 3, 12:07 pm)
Re: [PATCH] git-archive: document CWD effect, Junio C Hamano, (Sun Apr 8, 7:21 pm)
Re: [PATCH] git-archive: document CWD effect, Andy Parkins, (Mon Apr 9, 4:37 pm)
Re: [PATCH] git-archive: document CWD effect, , (Tue Apr 10, 10:24 am)
Re: [PATCH] git-archive: document CWD effect, Junio C Hamano, (Tue Apr 10, 5:49 pm)
Re: bug in git-archive?, Johannes Schindelin, (Sat Mar 3, 12:09 pm)