Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ls-files: align format atoms with git ls-tree
@ 2023-05-13  9:11 ZheNing Hu via GitGitGadget
  2023-05-13  9:11 ` [PATCH 1/2] ls-files: add %(objecttype) atom to format option ZheNing Hu via GitGitGadget
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: ZheNing Hu via GitGitGadget @ 2023-05-13  9:11 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason,
	Martin Monperrus, ZheNing Hu

Users sometimes want all format atoms of git ls-files --format to be
compatible with the format atoms of git ls-tree --format [1]. However, git
ls-files --format lacks the %(objecttype) and %(objectsize),
%(objectsize:padded) atoms compared to git ls-tree --format, causing
incompatibility. Therefore, these atoms are added to the --format of git
ls-files to resolve the issue of incompatibility.

%(objecttype): get the object type of the file which is recorded in the
index. %(objectsize): get the object size of the file which is recorded in
the index, ("-" if the object is a commit or tree). %(objectsize:padded):
same as %(objectsize), but with a padded format.

v1: add %(objecttype) and %(objectsize) atos to git ls-files --format.

[1]:
https://lore.kernel.org/git/21183ea9-84e2-fd89-eb9b-419556680c07@gnieh.org/T/#u

ZheNing Hu (2):
  ls-files: add %(objecttype) atom to format option
  ls-files: add %(objectsize) atom to format option

 Documentation/git-ls-files.txt |  6 ++++++
 builtin/ls-files.c             | 27 ++++++++++++++++++++++++++
 t/t3013-ls-files-format.sh     | 35 ++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+)


base-commit: 5bc069e383539824fd3a0d897100d44bbe1f8a24
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1533%2Fadlternative%2Fzh%2Fls-files-formats-expand-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1533/adlternative/zh/ls-files-formats-expand-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1533
-- 
gitgitgadget

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

end of thread, other threads:[~2023-05-23  9:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-13  9:11 [PATCH 0/2] ls-files: align format atoms with git ls-tree ZheNing Hu via GitGitGadget
2023-05-13  9:11 ` [PATCH 1/2] ls-files: add %(objecttype) atom to format option ZheNing Hu via GitGitGadget
2023-05-15  5:00   ` Junio C Hamano
2023-05-18 10:02     ` ZheNing Hu
2023-05-13  9:11 ` [PATCH 2/2] ls-files: add %(objectsize) " ZheNing Hu via GitGitGadget
2023-05-15  5:03   ` Junio C Hamano
2023-05-23  9:00 ` [PATCH v2] ls-files: aligin format atoms wtih ls-tree ZheNing Hu via GitGitGadget

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 read-only IMAP folder(s) and NNTP newsgroup(s).