* [PATCH] git-archive documentation: .gitattributes must be committed
@ 2010-02-10 2:51 Francois Marier
2010-02-10 19:07 ` René Scharfe
0 siblings, 1 reply; 8+ messages in thread
From: Francois Marier @ 2010-02-10 2:51 UTC (permalink / raw)
To: git; +Cc: Francois Marier
Add a note to the documentation stating that the .gitattributes
file must be present (i.e. committed) in the named tree that is
exported.
This can be a bit confusing because it's different from .gitignore
which takes effect as soon as the file is created.
Signed-off-by: Francois Marier <fmarier@gmail.com>
---
Documentation/git-archive.txt | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 799c8b6..fcd681d 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -112,6 +112,9 @@ export-subst::
expand several placeholders when adding this file to an archive.
See linkgit:gitattributes[5] for details.
+The .gitattributes file must be present in the named tree for it to take
+effect. Uncommitted attributes will not be considered in exports.
+
EXAMPLES
--------
git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::
--
1.6.6.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] git-archive documentation: .gitattributes must be committed
2010-02-10 2:51 [PATCH] git-archive documentation: .gitattributes must be committed Francois Marier
@ 2010-02-10 19:07 ` René Scharfe
2010-02-10 19:27 ` Junio C Hamano
0 siblings, 1 reply; 8+ messages in thread
From: René Scharfe @ 2010-02-10 19:07 UTC (permalink / raw)
To: Francois Marier; +Cc: git
Am 10.02.2010 03:51, schrieb Francois Marier:
> Add a note to the documentation stating that the .gitattributes
> file must be present (i.e. committed) in the named tree that is
> exported.
>
> This can be a bit confusing because it's different from .gitignore
> which takes effect as soon as the file is created.
>
> Signed-off-by: Francois Marier <fmarier@gmail.com>
> ---
> Documentation/git-archive.txt | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
> index 799c8b6..fcd681d 100644
> --- a/Documentation/git-archive.txt
> +++ b/Documentation/git-archive.txt
> @@ -112,6 +112,9 @@ export-subst::
> expand several placeholders when adding this file to an archive.
> See linkgit:gitattributes[5] for details.
>
> +The .gitattributes file must be present in the named tree for it to take
> +effect. Uncommitted attributes will not be considered in exports.
> +
> EXAMPLES
> --------
> git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::
Yeah, the description of --worktree-attributes is a bit terse. The
lines you add make it appear almost as if this switch doesn't exist,
though; perhaps add a "unless --worktree-attributes is given" or similar
to one of the new sentences?
René
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] git-archive documentation: .gitattributes must be committed
2010-02-10 19:07 ` René Scharfe
@ 2010-02-10 19:27 ` Junio C Hamano
2010-02-10 19:33 ` Junio C Hamano
2010-02-10 20:00 ` René Scharfe
0 siblings, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2010-02-10 19:27 UTC (permalink / raw)
To: René Scharfe; +Cc: Francois Marier, git
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>> +The .gitattributes file must be present in the named tree for it to take
>> +effect. Uncommitted attributes will not be considered in exports.
>> +
>> EXAMPLES
>> --------
>> git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::
>
> Yeah, the description of --worktree-attributes is a bit terse. The
> lines you add make it appear almost as if this switch doesn't exist,
> though; perhaps add a "unless --worktree-attributes is given" or similar
> to one of the new sentences?
My impression has always been that people use attributes with archive more
often to _tweak_ how the archive is produced after the fact, and they do
so by modifying checked out .gitattributes (or $GIT_DIR/info/attributes)
than allowing a possibly stale .gitattributes file etched in stone^Wtree
being archived. So in that sense, probably --worktree-attributes should
have been the default.
By the way, if you commit the attributes file, then commit the removal of
that attributes file, would that removed attributes file take effect when
you archive HEAD^ (which still had the attribues file)? That's how I read
what the added description claims, but I somehow suspect that is not what
actually happens.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] git-archive documentation: .gitattributes must be committed
2010-02-10 19:27 ` Junio C Hamano
@ 2010-02-10 19:33 ` Junio C Hamano
2010-02-10 20:00 ` René Scharfe
1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2010-02-10 19:33 UTC (permalink / raw)
To: René Scharfe; +Cc: Francois Marier, git
Junio C Hamano <gitster@pobox.com> writes:
> By the way, if you commit the attributes file, then commit the removal of
> that attributes file, would that removed attributes file take effect when
> you archive HEAD^ (which still had the attribues file)? That's how I read
> what the added description claims, but I somehow suspect that is not what
> actually happens.
Scratch this part, please. You do read the tree into the index to make
it happen.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] git-archive documentation: .gitattributes must be committed
2010-02-10 19:27 ` Junio C Hamano
2010-02-10 19:33 ` Junio C Hamano
@ 2010-02-10 20:00 ` René Scharfe
2010-02-10 20:18 ` Junio C Hamano
1 sibling, 1 reply; 8+ messages in thread
From: René Scharfe @ 2010-02-10 20:00 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Francois Marier, git, Nguyen Thai Ngoc Duy
Am 10.02.2010 20:27, schrieb Junio C Hamano:
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>
>>> +The .gitattributes file must be present in the named tree for it to take
>>> +effect. Uncommitted attributes will not be considered in exports.
>>> +
>>> EXAMPLES
>>> --------
>>> git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::
>>
>> Yeah, the description of --worktree-attributes is a bit terse. The
>> lines you add make it appear almost as if this switch doesn't exist,
>> though; perhaps add a "unless --worktree-attributes is given" or similar
>> to one of the new sentences?
>
> My impression has always been that people use attributes with archive more
> often to _tweak_ how the archive is produced after the fact, and they do
> so by modifying checked out .gitattributes (or $GIT_DIR/info/attributes)
> than allowing a possibly stale .gitattributes file etched in stone^Wtree
> being archived. So in that sense, probably --worktree-attributes should
> have been the default.
That was the case up to ba053ea9 (April 2009, archive: do not read
.gitattributes in working directory). I think that the current
behaviour makes sense because it provides a repeatable default.
René
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] git-archive documentation: .gitattributes must be committed
2010-02-10 20:00 ` René Scharfe
@ 2010-02-10 20:18 ` Junio C Hamano
2010-02-10 20:33 ` Junio C Hamano
0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2010-02-10 20:18 UTC (permalink / raw)
To: René Scharfe; +Cc: Francois Marier, git, Nguyen Thai Ngoc Duy
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> ... I think that the current
> behaviour makes sense because it provides a repeatable default.
I wouldn't insist on changing the default again too strongly, but I think
the --worktree-attributes option should be advertised better in the
documentation, as that mode of operation seems to match what the users
expect better, and I think that is how this thread started.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] git-archive documentation: .gitattributes must be committed
2010-02-10 20:18 ` Junio C Hamano
@ 2010-02-10 20:33 ` Junio C Hamano
2010-02-11 3:48 ` Francois Marier
0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2010-02-10 20:33 UTC (permalink / raw)
To: Francois Marier; +Cc: René Scharfe, git, Nguyen Thai Ngoc Duy
Junio C Hamano <gitster@pobox.com> writes:
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>
>> ... I think that the current
>> behaviour makes sense because it provides a repeatable default.
>
> I wouldn't insist on changing the default again too strongly, but I think
> the --worktree-attributes option should be advertised better in the
> documentation, as that mode of operation seems to match what the users
> expect better, and I think that is how this thread started.
How about this? Instead of stopping at saying "it is taken from the tree
and must be committed, period", we should continue giving insn to help
people who didn't do so to achieve what they want to do.
-- >8 --
Subject: archive documentation: attributes are taken from the tree by default
By default, git-archive takes attributes from the tree being archived.
People however often wonder why their attempts to affect the way how the
command archives their tree by changing .gitattributes in their work tree
fail.
Add a bit of explanatory note to tell them how to achieve what they want
to do.
Noticed-by: Francois Marier
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/git-archive.txt | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 799c8b6..8d3e666 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -112,6 +112,14 @@ export-subst::
expand several placeholders when adding this file to an archive.
See linkgit:gitattributes[5] for details.
+Note that attributes are by default taken from the `.gitattributes` files
+in the tree that is being archived. If you want to tweak the way the
+output is generated after the fact (e.g. you committed without adding an
+appropriate export-ignore in its `.gitattributes`), adjust the checked out
+`.gitattributes` file as necessary and use `--work-tree-attributes`
+option. Alternatively you can keep necessary attributes that should apply
+while archiving any tree in your `$GIT_DIR/info/attributes` file.
+
EXAMPLES
--------
git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] git-archive documentation: .gitattributes must be committed
2010-02-10 20:33 ` Junio C Hamano
@ 2010-02-11 3:48 ` Francois Marier
0 siblings, 0 replies; 8+ messages in thread
From: Francois Marier @ 2010-02-11 3:48 UTC (permalink / raw)
To: Junio C Hamano; +Cc: René Scharfe, git, Nguyen Thai Ngoc Duy
On 2010-02-10 at 12:33:58, Junio C Hamano wrote:
> +Note that attributes are by default taken from the `.gitattributes` files
> +in the tree that is being archived. If you want to tweak the way the
> +output is generated after the fact (e.g. you committed without adding an
> +appropriate export-ignore in its `.gitattributes`), adjust the checked out
> +`.gitattributes` file as necessary and use `--work-tree-attributes`
> +option. Alternatively you can keep necessary attributes that should apply
> +while archiving any tree in your `$GIT_DIR/info/attributes` file.
Looks good to me.
--
Francois Marier identi.ca/fmarier
http://feeding.cloud.geek.nz twitter.com/fmarier
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-02-11 3:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10 2:51 [PATCH] git-archive documentation: .gitattributes must be committed Francois Marier
2010-02-10 19:07 ` René Scharfe
2010-02-10 19:27 ` Junio C Hamano
2010-02-10 19:33 ` Junio C Hamano
2010-02-10 20:00 ` René Scharfe
2010-02-10 20:18 ` Junio C Hamano
2010-02-10 20:33 ` Junio C Hamano
2010-02-11 3:48 ` Francois Marier
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).