{"thread":{"id":"21794","subject":"git archive without path","startedAt":"2009-11-30T12:32:03Z","lastAt":"2009-12-04T23:11:01Z","messageCount":5,"participants":["Dmitry Potapov","Michael J Gruber","Junio C Hamano","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"128761","messageId":"20091130123203.GA11235@dpotapov.dyndns.org","threadId":"21794","inReplyTo":null,"subject":"git archive without path","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2009-11-30T12:32:03Z","receivedAt":"2009-11-30T12:32:03Z","isPatch":false,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"Hi!\n\nI have never run \"git archive\" inside of a subdirectory but somehow I\nhave always assumed that it creates an archive containing all files in\nit regardless the current directory. In fact, the git-archive man page\nsays so:\n\npath\n    If one or more paths are specified, include only these in the\n    archive, otherwise include all files and subdirectories.\n\n\nBut it turned out that \"git archive\" works as \"git archive .\", i.e.\nadds files starting with the current directory. Is any rational for\nthis behavior? It smells to me like a bug rather than a feature. I\ncannot imagine wanting to create archive containing just part of the\nwhole repository just because he happened to be in that directory,\nand documentation clearly says that all files should be added unless\none or more paths are specified.\n\n\nDmitry\n"},{"id":"128764","messageId":"4B13C2FE.3040707@drmicha.warpmail.net","threadId":"21794","inReplyTo":"20091130123203.GA11235@dpotapov.dyndns.org","subject":"Re: git archive without path","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-11-30T13:05:02Z","receivedAt":"2009-11-30T13:05:02Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Dmitry Potapov venit, vidit, dixit 30.11.2009 13:32:\n> Hi!\n> \n> I have never run \"git archive\" inside of a subdirectory but somehow I\n> have always assumed that it creates an archive containing all files in\n> it regardless the current directory. In fact, the git-archive man page\n> says so:\n> \n> path\n>     If one or more paths are specified, include only these in the\n>     archive, otherwise include all files and subdirectories.\n> \n> \n> But it turned out that \"git archive\" works as \"git archive .\", i.e.\n> adds files starting with the current directory. Is any rational for\n> this behavior? It smells to me like a bug rather than a feature. I\n> cannot imagine wanting to create archive containing just part of the\n> whole repository just because he happened to be in that directory,\n> and documentation clearly says that all files should be added unless\n> one or more paths are specified.\n\nDepends on the definition of \"all\" :)\n\nIn fact: Two mighty powers are fighting right now for the primacy in the\nLand of the Git, and both carry the name \"consistency\" on their flags.\nOne is the \"order of the consistency of generations\", also named\n\"backwards compatibility\", and one is the \"order of the consistency of\ncommands\", also named \"user experience\".\n\nMany commands have different defaults with respect to how they behave in\na subdirectory (compare status to ls-files, e.g.), and the discussion\nabout how to best change that are underway, most prominently in the case\nof git grep. I expect that we'll have a gradual migration path towards a\n\"full-tree\" default, but that is just my personal interpretation of the\ncurrent \"battle\". In the short term the best that we can hope for is a\nconsistent, convenient notation which enforcers a specific behaviour,\nsuch as \"/\" (non-existent) versus \".\" (existent).\n\nCheers,\nMichael\n"},{"id":"128783","messageId":"37fcd2780911300745r79c0cb54ifc3af5e79bb963e4@mail.gmail.com","threadId":"21794","inReplyTo":"4B13C2FE.3040707@drmicha.warpmail.net","subject":"Re: git archive without path","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2009-11-30T15:45:35Z","receivedAt":"2009-11-30T15:45:35Z","isPatch":false,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"On Mon, Nov 30, 2009 at 4:05 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n>\n> Depends on the definition of \"all\" :)\n\nI don't think it caries any restriction clause in this case....\n\n>\n> In fact: Two mighty powers are fighting right now for the primacy in the\n> Land of the Git, and both carry the name \"consistency\" on their flags.\n> One is the \"order of the consistency of generations\", also named\n> \"backwards compatibility\", and one is the \"order of the consistency of\n> commands\", also named \"user experience\".\n>\n> Many commands have different defaults with respect to how they behave in\n> a subdirectory (compare status to ls-files, e.g.), and the discussion\n> about how to best change that are underway, most prominently in the case\n> of git grep.\n\nWell, \"order of the consistency\" is a noble cause, but I don't think the\nsituations are comparable. The man page for git-grep has never claimed\nthat git grep works on all files. Also, git grep works on the working tree\nby default, so defaulting to the current working directory at least makes\nsome sense. I cannot say the same about git-archive, which only works\non the repository and if I specified some revision without any path then\nI expect to have the whole archive not some part of it just because I\nhappened to be in some subdirectory.\n\nSo, in the case of git-grep, we speak about changing the behavior that\nwas well-known, often used, and documented as such. On contrast,\ngit-archive documented as including all files if path is not specified.\n\nDmitry\n"},{"id":"128786","messageId":"7vljhootqq.fsf@alter.siamese.dyndns.org","threadId":"21794","inReplyTo":"4B13C2FE.3040707@drmicha.warpmail.net","subject":"Re: git archive without path","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-30T16:35:57Z","receivedAt":"2009-11-30T16:35:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Depends on the definition of \"all\" :)\n>\n> In fact: Two mighty powers are fighting right now for the primacy in the\n> Land of the Git, and both carry the name \"consistency\" on their flags.\n> One is the \"order of the consistency of generations\", also named\n> \"backwards compatibility\", and one is the \"order of the consistency of\n> commands\", also named \"user experience\".\n\nYou need to throw in another \"work similarly to the counterpart outside\ngit world\" and you will have a better picture.  This third consistency\noften sides with the first one.\n\nIn the case of \"git archive\" (and \"git grep\" in the other thread), it\nworks like you run \"tar\" (and \"grep -r\", for \"git grep\") both because the\noriginal implementor wanted a version of \"tar\" (\"grep\") that works inside\ngit world, and early adopters and users found the third consistency easy\nto work with, and that is why the third consistency grew into the first\none.\n"},{"id":"129249","messageId":"4B199705.5010202@lsrfire.ath.cx","threadId":"21794","inReplyTo":"20091130123203.GA11235@dpotapov.dyndns.org","subject":"Re: git archive without path","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2009-12-04T23:11:01Z","receivedAt":"2009-12-04T23:11:01Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Dmitry Potapov schrieb:\n> I have never run \"git archive\" inside of a subdirectory but somehow I\n> have always assumed that it creates an archive containing all files in\n> it regardless the current directory. In fact, the git-archive man page\n> says so:\n> \n> path\n>     If one or more paths are specified, include only these in the\n>     archive, otherwise include all files and subdirectories.\n\nThis sentence doesn't specify whose files and subdirectories are to be\nincluded -- those in the repository's root or those in the current\ndirectory.  Let's fix that.\n\n-- >8 --\nSubject: archive: clarify description of path parameter\n\nMention that path parameters are based on the current working directory.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n--\n Documentation/git-archive.txt |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt\nindex 3d1c1e7..e579791 100644\n--- a/Documentation/git-archive.txt\n+++ b/Documentation/git-archive.txt\n@@ -74,8 +74,9 @@ OPTIONS\n \tThe tree or commit to produce an archive for.\n \n path::\n-\tIf one or more paths are specified, include only these in the\n-\tarchive, otherwise include all files and subdirectories.\n+\tWithout an optional path parameter, all files and subdirectories\n+\tof the current working directory are included in the archive.\n+\tIf one or more paths are specified, only these are included.\n \n BACKEND EXTRA OPTIONS\n ---------------------\n"}]}