{"thread":{"id":"22596","subject":"[PATCH] git-archive documentation: .gitattributes must be committed","startedAt":"2010-02-10T02:51:24Z","lastAt":"2010-02-11T03:48:03Z","messageCount":8,"participants":["Francois Marier","René Scharfe","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"134109","messageId":"1265770284-14830-1-git-send-email-fmarier@gmail.com","threadId":"22596","inReplyTo":null,"subject":"[PATCH] git-archive documentation: .gitattributes must be committed","fromName":"Francois Marier","fromEmail":"fmarier@gmail.com","sentAt":"2010-02-10T02:51:24Z","receivedAt":"2010-02-10T02:51:24Z","isPatch":true,"sender":{"key":"fmarier@gmail.com","avatar":null},"body":"Add a note to the documentation stating that the .gitattributes\nfile must be present (i.e. committed) in the named tree that is\nexported.\n\nThis can be a bit confusing because it's different from .gitignore\nwhich takes effect as soon as the file is created.\n\nSigned-off-by: Francois Marier <fmarier@gmail.com>\n---\n Documentation/git-archive.txt |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt\nindex 799c8b6..fcd681d 100644\n--- a/Documentation/git-archive.txt\n+++ b/Documentation/git-archive.txt\n@@ -112,6 +112,9 @@ export-subst::\n \texpand several placeholders when adding this file to an archive.\n \tSee linkgit:gitattributes[5] for details.\n \n+The .gitattributes file must be present in the named tree for it to take\n+effect. Uncommitted attributes will not be considered in exports.\n+\n EXAMPLES\n --------\n git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::\n-- \n1.6.6.1\n"},{"id":"134166","messageId":"4B7303FC.6070701@lsrfire.ath.cx","threadId":"22596","inReplyTo":"1265770284-14830-1-git-send-email-fmarier@gmail.com","subject":"Re: [PATCH] git-archive documentation: .gitattributes must be committed","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2010-02-10T19:07:40Z","receivedAt":"2010-02-10T19:07:40Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 10.02.2010 03:51, schrieb Francois Marier:\n> Add a note to the documentation stating that the .gitattributes\n> file must be present (i.e. committed) in the named tree that is\n> exported.\n> \n> This can be a bit confusing because it's different from .gitignore\n> which takes effect as soon as the file is created.\n> \n> Signed-off-by: Francois Marier <fmarier@gmail.com>\n> ---\n>  Documentation/git-archive.txt |    3 +++\n>  1 files changed, 3 insertions(+), 0 deletions(-)\n> \n> diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt\n> index 799c8b6..fcd681d 100644\n> --- a/Documentation/git-archive.txt\n> +++ b/Documentation/git-archive.txt\n> @@ -112,6 +112,9 @@ export-subst::\n>  \texpand several placeholders when adding this file to an archive.\n>  \tSee linkgit:gitattributes[5] for details.\n>  \n> +The .gitattributes file must be present in the named tree for it to take\n> +effect. Uncommitted attributes will not be considered in exports.\n> +\n>  EXAMPLES\n>  --------\n>  git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::\n\nYeah, the description of --worktree-attributes is a bit terse.  The\nlines you add make it appear almost as if this switch doesn't exist,\nthough; perhaps add a \"unless --worktree-attributes is given\" or similar\nto one of the new sentences?\n\nRené\n"},{"id":"134168","messageId":"7v1vgsao21.fsf@alter.siamese.dyndns.org","threadId":"22596","inReplyTo":"4B7303FC.6070701@lsrfire.ath.cx","subject":"Re: [PATCH] git-archive documentation: .gitattributes must be committed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-10T19:27:50Z","receivedAt":"2010-02-10T19:27:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:\n\n>> +The .gitattributes file must be present in the named tree for it to take\n>> +effect. Uncommitted attributes will not be considered in exports.\n>> +\n>>  EXAMPLES\n>>  --------\n>>  git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::\n>\n> Yeah, the description of --worktree-attributes is a bit terse.  The\n> lines you add make it appear almost as if this switch doesn't exist,\n> though; perhaps add a \"unless --worktree-attributes is given\" or similar\n> to one of the new sentences?\n\nMy impression has always been that people use attributes with archive more\noften to _tweak_ how the archive is produced after the fact, and they do\nso by modifying checked out .gitattributes (or $GIT_DIR/info/attributes)\nthan allowing a possibly stale .gitattributes file etched in stone^Wtree\nbeing archived.  So in that sense, probably --worktree-attributes should\nhave been the default.\n\nBy the way, if you commit the attributes file, then commit the removal of\nthat attributes file, would that removed attributes file take effect when\nyou archive HEAD^ (which still had the attribues file)?  That's how I read\nwhat the added description claims, but I somehow suspect that is not what\nactually happens.\n"},{"id":"134169","messageId":"7vocjw998t.fsf@alter.siamese.dyndns.org","threadId":"22596","inReplyTo":"7v1vgsao21.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-archive documentation: .gitattributes must be committed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-10T19:33:06Z","receivedAt":"2010-02-10T19:33:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> By the way, if you commit the attributes file, then commit the removal of\n> that attributes file, would that removed attributes file take effect when\n> you archive HEAD^ (which still had the attribues file)?  That's how I read\n> what the added description claims, but I somehow suspect that is not what\n> actually happens.\n\nScratch this part, please.  You do read the tree into the index to make\nit happen.\n"},{"id":"134174","messageId":"4B731043.6010108@lsrfire.ath.cx","threadId":"22596","inReplyTo":"7v1vgsao21.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-archive documentation: .gitattributes must be committed","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2010-02-10T20:00:03Z","receivedAt":"2010-02-10T20:00:03Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 10.02.2010 20:27, schrieb Junio C Hamano:\n> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:\n> \n>>> +The .gitattributes file must be present in the named tree for it to take\n>>> +effect. Uncommitted attributes will not be considered in exports.\n>>> +\n>>>  EXAMPLES\n>>>  --------\n>>>  git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::\n>>\n>> Yeah, the description of --worktree-attributes is a bit terse.  The\n>> lines you add make it appear almost as if this switch doesn't exist,\n>> though; perhaps add a \"unless --worktree-attributes is given\" or similar\n>> to one of the new sentences?\n> \n> My impression has always been that people use attributes with archive more\n> often to _tweak_ how the archive is produced after the fact, and they do\n> so by modifying checked out .gitattributes (or $GIT_DIR/info/attributes)\n> than allowing a possibly stale .gitattributes file etched in stone^Wtree\n> being archived.  So in that sense, probably --worktree-attributes should\n> have been the default.\n\nThat was the case up to ba053ea9 (April 2009, archive: do not read\n.gitattributes in working directory).  I think that the current\nbehaviour makes sense because it provides a repeatable default.\n\nRené\n"},{"id":"134176","messageId":"7vr5os7sl2.fsf@alter.siamese.dyndns.org","threadId":"22596","inReplyTo":"4B731043.6010108@lsrfire.ath.cx","subject":"Re: [PATCH] git-archive documentation: .gitattributes must be committed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-10T20:18:17Z","receivedAt":"2010-02-10T20:18:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:\n\n> ...  I think that the current\n> behaviour makes sense because it provides a repeatable default.\n\nI wouldn't insist on changing the default again too strongly, but I think\nthe --worktree-attributes option should be advertised better in the\ndocumentation, as that mode of operation seems to match what the users\nexpect better, and I think that is how this thread started.\n"},{"id":"134180","messageId":"7veiks7rux.fsf@alter.siamese.dyndns.org","threadId":"22596","inReplyTo":"7vr5os7sl2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-archive documentation: .gitattributes must be committed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-10T20:33:58Z","receivedAt":"2010-02-10T20:33:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:\n>\n>> ...  I think that the current\n>> behaviour makes sense because it provides a repeatable default.\n>\n> I wouldn't insist on changing the default again too strongly, but I think\n> the --worktree-attributes option should be advertised better in the\n> documentation, as that mode of operation seems to match what the users\n> expect better, and I think that is how this thread started.\n\nHow about this?  Instead of stopping at saying \"it is taken from the tree\nand must be committed, period\", we should continue giving insn to help\npeople who didn't do so to achieve what they want to do.\n\n-- >8 --\nSubject: archive documentation: attributes are taken from the tree by default\n\nBy default, git-archive takes attributes from the tree being archived.\nPeople however often wonder why their attempts to affect the way how the\ncommand archives their tree by changing .gitattributes in their work tree\nfail.\n\nAdd a bit of explanatory note to tell them how to achieve what they want\nto do.\n\nNoticed-by: Francois Marier\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-archive.txt |    8 ++++++++\n 1 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt\nindex 799c8b6..8d3e666 100644\n--- a/Documentation/git-archive.txt\n+++ b/Documentation/git-archive.txt\n@@ -112,6 +112,14 @@ export-subst::\n \texpand several placeholders when adding this file to an archive.\n \tSee linkgit:gitattributes[5] for details.\n \n+Note that attributes are by default taken from the `.gitattributes` files\n+in the tree that is being archived.  If you want to tweak the way the\n+output is generated after the fact (e.g. you committed without adding an\n+appropriate export-ignore in its `.gitattributes`), adjust the checked out\n+`.gitattributes` file as necessary and use `--work-tree-attributes`\n+option.  Alternatively you can keep necessary attributes that should apply\n+while archiving any tree in your `$GIT_DIR/info/attributes` file.\n+\n EXAMPLES\n --------\n git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::\n"},{"id":"134205","messageId":"20100211034802.GS9853@isafjordur.dyndns.org","threadId":"22596","inReplyTo":"7veiks7rux.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-archive documentation: .gitattributes must be committed","fromName":"Francois Marier","fromEmail":"fmarier@gmail.com","sentAt":"2010-02-11T03:48:03Z","receivedAt":"2010-02-11T03:48:03Z","isPatch":true,"sender":{"key":"fmarier@gmail.com","avatar":null},"body":"On 2010-02-10 at 12:33:58, Junio C Hamano wrote:\n> +Note that attributes are by default taken from the `.gitattributes` files\n> +in the tree that is being archived.  If you want to tweak the way the\n> +output is generated after the fact (e.g. you committed without adding an\n> +appropriate export-ignore in its `.gitattributes`), adjust the checked out\n> +`.gitattributes` file as necessary and use `--work-tree-attributes`\n> +option.  Alternatively you can keep necessary attributes that should apply\n> +while archiving any tree in your `$GIT_DIR/info/attributes` file.\n\nLooks good to me.\n\n-- \nFrancois Marier                         identi.ca/fmarier\nhttp://feeding.cloud.geek.nz          twitter.com/fmarier\n"}]}