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

[PATCH] Documentation: Update information about <format> in git-for-each-ref

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 28, 2006, 17:30 UTC
Message-ID
<200610281930.05889.jnareb@gmail.com>

Update information about value of <format> used when it is left unspecified. Add information about `%%` and `%xx` interpolation (URL encoding).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Could any of you review this, fix wording (if needed)?

By the way one thing missing from git-for-each-ref to use it in gitweb without changing its output is ablility to sort on "epoch", i.e. taggerdate for tags and committerdate for commits. This is needed to sort heavyweight and lightweight tags together on epoch in "summary" and "tags" views in gitweb. (It is not needed for heads/branches, but it is the tags sorting that cripples gitweb "summary" view performance.)

We could either add "fake" field `date` which will be `taggerdate` for tags and `committerdate` for commits, and empty for trees and blobs, or allow in <key> for more than one field to be specified.

I also wish for change of %(field) to %{field}, adding %nn{field} and %-nn{field} field width specifiers, committerepoch and committertz fields (and equivalent for tagger and author) or %{committer:date} like field-format specifiers. And for peace on Earth while at it... ;-)

 Documentation/git-for-each-ref.txt |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
index d5fdcef..4af1ebf 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -38,7 +38,11 @@ OPTIONS
 	is prefixed with an asterisk (`*`) and the ref points
 	at a tag object, the value for the field in the object
 	tag refers is used.  When unspecified, defaults to
-	`%(refname)`.
+	`%(objectname) SPC %(objecttype) TAB %(refname)`.
+	It also interpolates `%%` to `%`, and `%xx` where `xx`
+	are hex digits interpolates to character with hex code
+	`xx`; for example `%00` interpolates to `\0` (NUL),
+	`%09` to `\t` (TAB) and `%0a` to `\n` (LF).
 
 <pattern>::
 	If given, the name of the ref is matched against this
-- 
1.4.3.3
Next: Junio C Hamano
Message 1 of 15 in “Documentation: Update information about <format> in git-for-each-ref”
  1. Documentation: Update information about <format> in git-for-each-refJakub Narebski, Oct 28, 2006
  2. Junio C HamanoOct 28, 2006
  3. Jakub NarebskiOct 28, 2006
  4. Andreas EricssonNov 1, 2006
  5. Junio C HamanoNov 1, 2006
  6. Andreas EricssonNov 1, 2006
  7. Junio C HamanoNov 1, 2006
  8. Johannes SchindelinNov 1, 2006
  9. 1/2 for-each-ref: "creator" and "creatordate" fieldsJakub Narebski, Nov 2, 2006
  10. 2/2 gitweb: Use git-for-each-ref to generate list of heads and/or tagsJakub Narebski, Nov 2, 2006
  11. Junio C HamanoNov 3, 2006
  12. Jakub NarebskiNov 3, 2006
  13. Junio C HamanoNov 3, 2006
  14. Jakub NarebskiNov 3, 2006
  15. Junio C HamanoOct 28, 2006

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.