git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 6/6] ref-filter: add docs for new options

From
Olga Telezhnaya <olyatelezhnaya@gmail.com>
Date
Jan 10, 2019, 06:32 UTC
Message-ID
<0102016836761c7a-c5b92b9e-ea5a-4032-bd2d-73c67c5b5fef-000000@eu-west-1.amazonses.com>
In-Reply-To
<0102016836761b8b-8616fc01-3489-4e53-a5b7-cd4b52e20e01-000000@eu-west-1.amazonses.com>

Add documentation for formatting options objectsize:disk and deltabase.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
---
 Documentation/git-for-each-ref.txt | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
index 901faef1bfdce..774cecc7ede78 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -128,13 +128,18 @@ objecttype::
 
 objectsize::
 	The size of the object (the same as 'git cat-file -s' reports).
-
+	Append `:disk` to get the size, in bytes, that the object takes up on
+	disk. See the note about on-disk sizes in the `CAVEATS` section below.
 objectname::
 	The object name (aka SHA-1).
 	For a non-ambiguous abbreviation of the object name append `:short`.
 	For an abbreviation of the object name with desired length append
 	`:short=<length>`, where the minimum length is MINIMUM_ABBREV. The
 	length may be exceeded to ensure unique object names.
+deltabase::
+	This expands to the object name of the delta base for the
+	given object, if it is stored as a delta.  Otherwise it
+	expands to the null object name (all zeroes).
 
 upstream::
 	The name of a local ref which can be considered ``upstream''
@@ -361,6 +366,20 @@ This prints the authorname, if present.
 git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Authored by: %(authorname)%(end)"
 ------------
 
+CAVEATS
+-------
+
+Note that the sizes of objects on disk are reported accurately, but care
+should be taken in drawing conclusions about which refs or objects are
+responsible for disk usage. The size of a packed non-delta object may be
+much larger than the size of objects which delta against it, but the
+choice of which object is the base and which is the delta is arbitrary
+and is subject to change during a repack.
+
+Note also that multiple copies of an object may be present in the object
+database; in this case, it is undefined which copy's size or delta base
+will be reported.
+
 SEE ALSO
 --------
 linkgit:git-show-ref[1]

--
https://github.com/git/git/pull/552
Previous: Olga TelezhnayaNext: Olga Telezhnaya
Message 8 of 10 in “ref-filter: add new formatting options”
  1. 0/5 ref-filter: add new formatting optionsОля Тележная, Nov 9, 2018
  2. 0/5 ref-filter: add new formatting optionsОля Тележная, Dec 24, 2018
  3. Оля ТележнаяJan 10, 2019
  4. 1/6 ref-filter: add objectsize:disk optionOlga Telezhnaya, Jan 10, 2019
  5. 5/6 ref-filter: add tests for deltabaseOlga Telezhnaya, Jan 10, 2019
  6. 4/6 ref-filter: add deltabase optionOlga Telezhnaya, Jan 10, 2019
  7. 2/6 ref-filter: add check for negative file sizeOlga Telezhnaya, Jan 10, 2019
  8. 6/6 ref-filter: add docs for new optionsOlga Telezhnaya, Jan 10, 2019
  9. 3/6 ref-filter: add tests for objectsize:diskOlga Telezhnaya, Jan 10, 2019
  10. Junio C HamanoJan 10, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.