git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-ls-tree.txt: fix the name of "%(objectsize:padded)"
@ 2022-04-07 15:52 Martin Ågren
  2022-04-07 17:11 ` Junio C Hamano
  2022-04-08 16:00 ` [PATCH] ls-tree doc: document interaction with submodules Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Ågren @ 2022-04-07 15:52 UTC (permalink / raw)
  To: git; +Cc: Ævar Arnfjörð Bjarmason, Teng Long

Commit 455923e0a1 ("ls-tree: introduce "--format" option", 2022-03-23)
introduced `--format` and the various placeholders it can take, such as
%(objectname) and %(objectsize).

At some point when that patch was being developed, those placeholders
had shorter names, e.g., %(name) and %(size), which can be seen in the
commit message of 455923e0a1. One instance of "%(size:padded)" also
managed to enter the documentation in the final version of the patch.
Correct it to "%(objectsize:padded)".

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-ls-tree.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index 43aebb9938..8f31e2ee9d 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -156,7 +156,7 @@ objectname::
 	The name of the object.
 objectsize[:padded]::
 	The size of the object ("-" if it's a tree).
-	It also supports a padded format of size with "%(size:padded)".
+	It also supports a padded format of size with "%(objectsize:padded)".
 path::
 	The pathname of the object.
 
-- 
2.36.0.rc0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] git-ls-tree.txt: fix the name of "%(objectsize:padded)"
  2022-04-07 15:52 [PATCH] git-ls-tree.txt: fix the name of "%(objectsize:padded)" Martin Ågren
@ 2022-04-07 17:11 ` Junio C Hamano
  2022-04-08 16:00 ` [PATCH] ls-tree doc: document interaction with submodules Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2022-04-07 17:11 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git, Ævar Arnfjörð Bjarmason, Teng Long

Martin Ågren <martin.agren@gmail.com> writes:

> Commit 455923e0a1 ("ls-tree: introduce "--format" option", 2022-03-23)
> introduced `--format` and the various placeholders it can take, such as
> %(objectname) and %(objectsize).
>
> At some point when that patch was being developed, those placeholders
> had shorter names, e.g., %(name) and %(size), which can be seen in the
> commit message of 455923e0a1. One instance of "%(size:padded)" also
> managed to enter the documentation in the final version of the patch.
> Correct it to "%(objectsize:padded)".
>
> Signed-off-by: Martin Ågren <martin.agren@gmail.com>
> ---
>  Documentation/git-ls-tree.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks.


> diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
> index 43aebb9938..8f31e2ee9d 100644
> --- a/Documentation/git-ls-tree.txt
> +++ b/Documentation/git-ls-tree.txt
> @@ -156,7 +156,7 @@ objectname::
>  	The name of the object.
>  objectsize[:padded]::
>  	The size of the object ("-" if it's a tree).
> -	It also supports a padded format of size with "%(size:padded)".
> +	It also supports a padded format of size with "%(objectsize:padded)".
>  path::
>  	The pathname of the object.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ls-tree doc: document interaction with submodules
  2022-04-07 15:52 [PATCH] git-ls-tree.txt: fix the name of "%(objectsize:padded)" Martin Ågren
  2022-04-07 17:11 ` Junio C Hamano
@ 2022-04-08 16:00 ` Ævar Arnfjörð Bjarmason
  2022-04-08 18:20   ` Junio C Hamano
  1 sibling, 1 reply; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-04-08 16:00 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Martin Ågren, Teng Long,
	Ævar Arnfjörð Bjarmason

The ls-tree documentation had never been updated after it learned to
interact with submodules to explicitly mention them. The initial
support was added in f35a6d3bce7 (Teach core object handling functions
about gitlinks, 2007-04-09). E.g. the discussion of --long added in
f35a6d3bce7 (Teach core object handling functions about gitlinks,
2007-04-09) didn't explicitly mention them.

But this documentation added in 455923e0a15 (ls-tree: introduce
"--format" option, 2022-03-23) had no such excuse, and was actively
misleading by providing an exhaustive but incomplete list of object
types we'd emit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

On Thu, Apr 07 2022, Martin Ågren wrote:

> Commit 455923e0a1 ("ls-tree: introduce "--format" option", 2022-03-23)
> introduced `--format` and the various placeholders it can take, such as
> %(objectname) and %(objectsize).
>
> At some point when that patch was being developed, those placeholders
> had shorter names, e.g., %(name) and %(size), which can be seen in the
> commit message of 455923e0a1. One instance of "%(size:padded)" also
> managed to enter the documentation in the final version of the patch.
> Correct it to "%(objectsize:padded)"

Thanks, perhaps this is also worth taking before the release, it's a
rather trivial inaccuracy in the docs, but something that's new since
v2.36.0.

I have some local patches to make "git ls-tree --recurse-submodules"
work, and noticed this again after it conflicted with your now-landed
fix.

 Documentation/git-ls-tree.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index 8f31e2ee9d4..0240adb8eec 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -151,11 +151,11 @@ names can be used:
 objectmode::
 	The mode of the object.
 objecttype::
-	The type of the object (`blob` or `tree`).
+	The type of the object (`commit`, `blob` or `tree`).
 objectname::
 	The name of the object.
 objectsize[:padded]::
-	The size of the object ("-" if it's a tree).
+	The size of a `blob` object ("-" if it's a `commit` or `tree`).
 	It also supports a padded format of size with "%(objectsize:padded)".
 path::
 	The pathname of the object.
-- 
2.36.0.rc0.836.g0771277f920


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ls-tree doc: document interaction with submodules
  2022-04-08 16:00 ` [PATCH] ls-tree doc: document interaction with submodules Ævar Arnfjörð Bjarmason
@ 2022-04-08 18:20   ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2022-04-08 18:20 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Martin Ågren, Teng Long

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Thanks, perhaps this is also worth taking before the release, it's a
> rather trivial inaccuracy in the docs, but something that's new since
> v2.36.0.
> ...
> diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
> index 8f31e2ee9d4..0240adb8eec 100644
> --- a/Documentation/git-ls-tree.txt
> +++ b/Documentation/git-ls-tree.txt
> @@ -151,11 +151,11 @@ names can be used:
>  objectmode::
>  	The mode of the object.
>  objecttype::
> -	The type of the object (`blob` or `tree`).
> +	The type of the object (`commit`, `blob` or `tree`).
>  objectname::
>  	The name of the object.
>  objectsize[:padded]::
> -	The size of the object ("-" if it's a tree).
> +	The size of a `blob` object ("-" if it's a `commit` or `tree`).
>  	It also supports a padded format of size with "%(objectsize:padded)".
>  path::
>  	The pathname of the object.

Makes sense.  Indeed we should have updated it when we added
gitlinks to trees.

Will queue.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-08 18:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 15:52 [PATCH] git-ls-tree.txt: fix the name of "%(objectsize:padded)" Martin Ågren
2022-04-07 17:11 ` Junio C Hamano
2022-04-08 16:00 ` [PATCH] ls-tree doc: document interaction with submodules Ævar Arnfjörð Bjarmason
2022-04-08 18:20   ` Junio C Hamano

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).