All of lore.kernel.org
 help / color / mirror / Atom feed
From: "ZheNing Hu via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Martin Monperrus" <martin.monperrus@gnieh.org>,
	"ZheNing Hu" <adlternative@gmail.com>
Subject: [PATCH 0/2] ls-files: align format atoms with git ls-tree
Date: Sat, 13 May 2023 09:11:37 +0000	[thread overview]
Message-ID: <pull.1533.git.1683969100.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2023-05-13  9:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13  9:11 ZheNing Hu via GitGitGadget [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1533.git.1683969100.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=adlternative@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.monperrus@gnieh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.