{"thread":{"id":"64376","subject":"git log format documentation/manpage","startedAt":"2025-10-24T08:06:11Z","lastAt":"2025-10-25T17:01:05Z","messageCount":4,"participants":["David Moberg","D. Ben Knoble","Junio C Hamano","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"529572","messageId":"KL1PR03MB5748DE5406618053D0A6CE0AEBF1A@KL1PR03MB5748.apcprd03.prod.outlook.com","threadId":"64376","inReplyTo":null,"subject":"git log format documentation/manpage","fromName":"David Moberg","fromEmail":"david.moberg@mediatek.com","sentAt":"2025-10-24T08:06:04Z","receivedAt":"2025-10-24T08:06:11Z","isPatch":false,"sender":{"key":"david.moberg@mediatek.com","avatar":null},"body":"Hi I'm trying to replicate the \"oneline\" log format and add notes to it. What I can't figure out:\n\n1. What is the format string that corresponds to pretty format \"oneline\"?\n2. What is the placeholder for the title-line? By searching for \"title-line\" in `man git log` I couldn't find anything. Surely this is in here somewhere?       \n   Searching for `full-commit-message` also left me empty-handed.\n3. How can I display notes (%N from `git notes add`) as in-line information (stripping away newlines at the end)?\n\nHow do I figure out the placeholders?\n\nSuggestion for manpage improvements:\n1. the pretty formats (oneline, short, ...) should come with a (t)format string that it corresponds to. They will act as great examples.\n2. Make sure the descriptions of the pretty formats (\"<title-line>\", \"<full-commit-message>\", ...) are searchable.\n\nKind Regards,\nDavid, kaddkaka, Moberg"},{"id":"529642","messageId":"CALnO6CBLUGgBMeRf0uLA=TKVaMQvap9Wpa4uTAGQD5he40xeWw@mail.gmail.com","threadId":"64376","inReplyTo":"KL1PR03MB5748DE5406618053D0A6CE0AEBF1A@KL1PR03MB5748.apcprd03.prod.outlook.com","subject":"Re: git log format documentation/manpage","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-10-25T13:42:03Z","receivedAt":"2025-10-25T13:42:16Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Fri, Oct 24, 2025 at 4:07 AM David Moberg <David.Moberg@mediatek.com> wrote:\n>\n> Hi I'm trying to replicate the \"oneline\" log format and add notes to it. What I can't figure out:\n>\n> 1. What is the format string that corresponds to pretty format \"oneline\"?\n> 2. What is the placeholder for the title-line? By searching for \"title-line\" in `man git log` I couldn't find anything. Surely this is in here somewhere?\n>    Searching for `full-commit-message` also left me empty-handed.\n> 3. How can I display notes (%N from `git notes add`) as in-line information (stripping away newlines at the end)?\n>\n> How do I figure out the placeholders?\n>\n> Suggestion for manpage improvements:\n> 1. the pretty formats (oneline, short, ...) should come with a (t)format string that it corresponds to. They will act as great examples.\n> 2. Make sure the descriptions of the pretty formats (\"<title-line>\", \"<full-commit-message>\", ...) are searchable.\n>\n> Kind Regards,\n> David, kaddkaka, Moberg\n\nI don't have the answer to everything, but for your goal, does\n`--oneline --notes` not give you something close enough?\n\nSince notes can be arbitrary text, making them \"inline\" with the\noneline format seems like an uphill battle to me.\n\n-- \nD. Ben Knoble\n"},{"id":"529645","messageId":"xmqq4irnndm3.fsf@gitster.g","threadId":"64376","inReplyTo":"CALnO6CBLUGgBMeRf0uLA=TKVaMQvap9Wpa4uTAGQD5he40xeWw@mail.gmail.com","subject":"Re: git log format documentation/manpage","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-25T16:35:32Z","receivedAt":"2025-10-25T16:35:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n\n> I don't have the answer to everything, but for your goal, does\n> `--oneline --notes` not give you something close enough?\n>\n> Since notes can be arbitrary text, making them \"inline\" with the\n> oneline format seems like an uphill battle to me.\n\nA commit log message is an arbitrary piece of text, so we gave the\ndistinction of %s (subject) vs %b (body) to allow us to say \"%h %s\"\nto show only the commit subject.\n\nThere is nothing similar for notes, so in that sense, you are\ncorrect to point out that only with %N, it would not be possible to\ncome up with universally good formatting, unless you somehow control\nwhat you write in your notes (e.g. limit yourself to oneliners).\n\nIf the rumored unification of format languages between \"git log\"\nfamily of commands and \"git for-each-ref\" family of commands ever\ncomes, then we might be able to borrow conditional formatting and\ntext manipulation primitives the latter may have in order to do\nthings like \"show the first line of note string, inside a pair of\nparentheses, but only do so when note does exist and not empty\".\n\nBut until the unification of format languages happens (which as far\nas I understand nobody is working on right now, even though I\nvaguely recall it was a topic in vogue for mentoring programs some\nyears ago), I do not think it is feasible.\n"},{"id":"529647","messageId":"5c5c37b6-c3eb-45fc-901a-0f8e7f6d7d0e@web.de","threadId":"64376","inReplyTo":"KL1PR03MB5748DE5406618053D0A6CE0AEBF1A@KL1PR03MB5748.apcprd03.prod.outlook.com","subject":"Re: git log format documentation/manpage","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2025-10-25T17:00:52Z","receivedAt":"2025-10-25T17:01:05Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"On 10/24/25 10:06 AM, David Moberg wrote:\n> Hi I'm trying to replicate the \"oneline\" log format and add notes to \n> it. What I can't figure out:\n> \n> 1. What is the format string that corresponds to pretty format \n> \"oneline\"?\n\n--oneline on terminal:        %C(auto)%h%(decorate) %s\n--oneline otherwise:          %C(auto)%h %s\n--format=oneline on terminal: %C(auto)%H%(decorate) %s\n--format=oneline otherwise:   %C(auto)%H %s\n\nThe %(decorate) part also depends on the config setting log.decorate.\n\n> 2. What is the placeholder for the title-line? By searching for \n> \"title-line\" in `man git log` I couldn't find anything. Surely this \n> is in here somewhere? Searching for `full-commit-message` also left \n> me empty-handed.\n\n%s for subject, %b for body, %B for the whole commit message (subject\nand body).  Email terms because Git was developed for Linux and commits\nwere exchanged on a mailing list, like we do here for Git.\n\n> 3. How can I display notes (%N from `git notes add`) as in-line \n> information (stripping away newlines at the end)?\n\nI don't think that's currently possible.  You might assume that %w\n(wrap) with a huge width would do it, but it doesn't.\n\n> How do I figure out the placeholders?\n> \n> Suggestion for manpage improvements:\n> 1. the pretty formats (oneline, short, ...) should come with a\n> (t)format string that it corresponds to. They will act as great\n> examples.\n\nGood idea.\n\nI would also prefer the named formats actually being implemented as\nthese format strings instead of being hand-coded -- for clarity,\nsimplicity and for proving that the placeholders are powerful enough.\n\n> 2. Make sure the descriptions of the pretty formats (\"<title-line>\",\n> \"<full-commit-message>\", ...) are searchable.\nExpanding the current one-word descriptions, e.g., with synonyms,\nseems like a good idea.  Care to send a doc patch?\n\nRené\n\n"}]}