git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Dmitry Potapov <dpotapov@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git archive without path
Date: Mon, 30 Nov 2009 14:05:02 +0100	[thread overview]
Message-ID: <4B13C2FE.3040707@drmicha.warpmail.net> (raw)
In-Reply-To: <20091130123203.GA11235@dpotapov.dyndns.org>

Dmitry Potapov venit, vidit, dixit 30.11.2009 13:32:
> Hi!
> 
> I have never run "git archive" inside of a subdirectory but somehow I
> have always assumed that it creates an archive containing all files in
> it regardless the current directory. In fact, the git-archive man page
> says so:
> 
> path
>     If one or more paths are specified, include only these in the
>     archive, otherwise include all files and subdirectories.
> 
> 
> But it turned out that "git archive" works as "git archive .", i.e.
> adds files starting with the current directory. Is any rational for
> this behavior? It smells to me like a bug rather than a feature. I
> cannot imagine wanting to create archive containing just part of the
> whole repository just because he happened to be in that directory,
> and documentation clearly says that all files should be added unless
> one or more paths are specified.

Depends on the definition of "all" :)

In fact: Two mighty powers are fighting right now for the primacy in the
Land of the Git, and both carry the name "consistency" on their flags.
One is the "order of the consistency of generations", also named
"backwards compatibility", and one is the "order of the consistency of
commands", also named "user experience".

Many commands have different defaults with respect to how they behave in
a subdirectory (compare status to ls-files, e.g.), and the discussion
about how to best change that are underway, most prominently in the case
of git grep. I expect that we'll have a gradual migration path towards a
"full-tree" default, but that is just my personal interpretation of the
current "battle". In the short term the best that we can hope for is a
consistent, convenient notation which enforcers a specific behaviour,
such as "/" (non-existent) versus "." (existent).

Cheers,
Michael

  reply	other threads:[~2009-11-30 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 12:32 git archive without path Dmitry Potapov
2009-11-30 13:05 ` Michael J Gruber [this message]
2009-11-30 15:45   ` Dmitry Potapov
2009-11-30 16:35   ` Junio C Hamano
2009-12-04 23:11 ` René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B13C2FE.3040707@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).