{"thread":{"id":"53044","subject":"[GSoC Project RFC] \"git log --oneline\" improvements","startedAt":"2020-03-20T23:11:40Z","lastAt":"2020-03-21T22:37:11Z","messageCount":4,"participants":["Parth Gala","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"393569","messageId":"28aee28c-8e8d-763a-66c7-d365025e56a2@gmail.com","threadId":"53044","inReplyTo":null,"subject":"[GSoC Project RFC] \"git log --oneline\" improvements","fromName":"Parth Gala","fromEmail":"parthpgala@gmail.com","sentAt":"2020-03-20T23:11:34Z","receivedAt":"2020-03-20T23:11:40Z","isPatch":false,"sender":{"key":"parthpgala@gmail.com","avatar":null},"body":"Hey everyone,\n\n\nI am Parth Gala. I am second year major in Electronics and Communications\nEngineering at Dwarkadas J. Sanghvi College of Engineering. I am interested\nin participating for GSoC 2020 under the Git organisation.\n\nFirst of all I would like to apologise for sending in my participation so\nlate. I lost 2 crucial weeks of discussion from the end of Feb due to some\npersonal problems. I was initially interested in working on the rewrite of\nsubmodule from shell to C, but after checking the mailing list I saw that\nShourya Shukla had already taken it up and had started work on it, so I\nfelt it wise to leave it to him. So all the reading that I did for\nsubmodules had to be repeated for this project.\n\nI went through the discussions here[1] and here[2] and what I could\nconclude from [1] is, the 'git log --oneline' command currently shows the\ndecorations of a commit before the commit message but after the shortened\nhash due to which the alignment of the messages is disturbed like this,\n\n     3f07dac29 (HEAD -> master) pathspec: don't error out on \nall-exclusionary pathspec patterns\n     ca4a562f2 pathspec magic: add '^' as alias for '!'\n     02555c1b2 ls-remote: add \"--diff\" option to show only refs that differ\n     6e3a7b339 (tag: v2.12.0-rc0, origin/master, origin/HEAD) Git 2.12-rc0\n     fafca0f72 Merge branch 'cw/log-updates-for-all-refs-really'\n     74dee5cfa Merge branch 'pl/complete-diff-submodule-diff'\n     36acf4123 Merge branch 'rs/object-id'\n\nAnd if the decorations were to be shown after the message and you were\nchecking the logs just to see the status of a branch rather than the\ncontents then you would again be at a disadvantage, since you would want\nto have them visible right next to the hashes. Besides decorations at the\nend would have the inconvenience of being truncated at the end of the line\non smaller screens.\n\nThis format for --oneline with decorations was decided upon,\n\n   b9df16a4c (HEAD -> master)\n             pathspec: don't error out on all-exclusionary pathspec patterns\n   91a491f05 pathspec magic: add '^' as alias for '!'\n   c8e05fd6d ls-remote: add \"--diff\" option to show only refs that differ\n   20769079d (tag: v2.12.0-rc2, origin/master, origin/HEAD)\n             Git 2.12-rc2\n   076c05393 Hopefully the final batch of mini-topics before the final\n\nIn [2] such formats with date and timestamp are discussed along with\ncompatibility for --graph option as well,\n\n   === 2015-09-17 ===\n   * ee6ad5f4 12:16 jch (tag: v2.5.3) Git 2.5.3\n     === 2015-09-09 ===\n   * b9d66899 14:22 js  am --skip/--abort: merge HEAD/ORIG_HEAD tree \ninto index\n   |   === 2015-09-04 ===\n   | * 27ea6f85 10:46 jch (tag: v2.5.2) Git 2.5.2\n   * 74b67638 10:36 jch (tag: v2.4.9) Git 2.4.9\n                        ..........\n   * ecad27cf 10:32 jch (tag: v2.3.9) Git 2.3.9\n\nSo these are the two main formats to be enhanced along with as many options\nof log as possible. What are your views on this ?\n\nAlso, I had submitted a patch series here[3] but I felt it was trivial so\ntook upon a bug fix[4] which is yet to be sent to the mailing list for\ndiscussions.\n\nI am currently drafting my proposal which I will send for discussion\nafter having received comments here.\n\nThanks :-),\n\nParth.\n\n[1] : \nhttps://lore.kernel.org/git/xmqqeg42fslw.fsf@gitster.mtv.corp.google.com/T/#t\n[2] : \nhttps://lore.kernel.org/git/CA+55aFwT2HUBzZO8Gpt9tHoJtdRxv9oe3TDoSH5jcEOixRNBXg@mail.gmail.com/T/#t\n[3] : \nhttps://public-inbox.org/git/pull.545.git.1581535151.gitgitgadget@gmail.com/#t\n[4] : https://github.com/gitgitgadget/git/pull/582\n"},{"id":"393571","messageId":"xmqqwo7ea99z.fsf@gitster.c.googlers.com","threadId":"53044","inReplyTo":"28aee28c-8e8d-763a-66c7-d365025e56a2@gmail.com","subject":"Re: [GSoC Project RFC] \"git log --oneline\" improvements","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-20T23:36:40Z","receivedAt":"2020-03-20T23:36:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Parth Gala <parthpgala@gmail.com> writes:\n\n> I went through the discussions here[1] and here[2] and what I could\n> conclude from [1] is, the 'git log --oneline' command currently shows the\n> decorations of a commit before the commit message but after the shortened\n> hash due to which the alignment of the messages is disturbed like this,\n>\n>     3f07dac29 (HEAD -> master) pathspec: don't error out on all-excl...\n>     ca4a562f2 pathspec magic: add '^' as alias for '!'\n>     02555c1b2 ls-remote: add \"--diff\" option to show only refs that differ\n>     6e3a7b339 (tag: v2.12.0-rc0, origin/master, origin/HEAD) Git 2.12-rc0\n>     fafca0f72 Merge branch 'cw/log-updates-for-all-refs-really'\n>     74dee5cfa Merge branch 'pl/complete-diff-submodule-diff'\n>     36acf4123 Merge branch 'rs/object-id'\n>\n> And if the decorations were to be shown after the message and you were\n> checking the logs just to see the status of a branch rather than the\n> contents then you would again be at a disadvantage, since you would want\n> to have them visible right next to the hashes. Besides decorations at the\n> end would have the inconvenience of being truncated at the end of the line\n> on smaller screens.\n>\n> This format for --oneline with decorations was decided upon,\n>\n>   b9df16a4c (HEAD -> master)\n>             pathspec: don't error out on all-exclusionary pathspec patterns\n>   91a491f05 pathspec magic: add '^' as alias for '!'\n>   c8e05fd6d ls-remote: add \"--diff\" option to show only refs that differ\n>   20769079d (tag: v2.12.0-rc2, origin/master, origin/HEAD)\n>             Git 2.12-rc2\n>   076c05393 Hopefully the final batch of mini-topics before the final\n\nHmph.  Who decided that such a format is a good idea?  I do not see\nanything decided positively in the thread [1] you referred to.\n\n> In [2] such formats with date and timestamp are discussed along with\n> compatibility for --graph option as well,\n>\n>   === 2015-09-17 ===\n>   * ee6ad5f4 12:16 jch (tag: v2.5.3) Git 2.5.3\n>     === 2015-09-09 ===\n>   * b9d66899 14:22 js  am --skip/--abort: merge HEAD/ORIG_HEAD tree\n> into index\n>   |   === 2015-09-04 ===\n>   | * 27ea6f85 10:46 jch (tag: v2.5.2) Git 2.5.2\n>   * 74b67638 10:36 jch (tag: v2.4.9) Git 2.4.9\n>                        ..........\n>   * ecad27cf 10:32 jch (tag: v2.3.9) Git 2.3.9\n>\n> So these are the two main formats to be enhanced along with as many options\n> of log as possible. What are your views on this ?\n>\n\nMaking the \"--oneline\" format to consume more than one line for a\ncommit is probably not what we want anyway.\n\nComing up with a new format (say, \"--pretty=concise\"), or a new\noption that tweaks the behaviour of \"--oneline\", are possible ways\nto add a new feature without disrupting existing users' use cases,\nthough.\n\nThanks.\n\n"},{"id":"393662","messageId":"a67e0d2e-5bcd-8ac7-648e-51c1dc0f72ef@gmail.com","threadId":"53044","inReplyTo":"xmqqwo7ea99z.fsf@gitster.c.googlers.com","subject":"Re: [GSoC Project RFC] \"git log --oneline\" improvements","fromName":"Parth Gala","fromEmail":"parthpgala@gmail.com","sentAt":"2020-03-21T22:05:14Z","receivedAt":"2020-03-21T22:05:19Z","isPatch":false,"sender":{"key":"parthpgala@gmail.com","avatar":null},"body":"> Parth Gala <parthpgala@gmail.com> writes:\n>\n>> I went through the discussions here[1] and here[2] and what I could\n>> conclude from [1] is, the 'git log --oneline' command currently shows the\n>> decorations of a commit before the commit message but after the shortened\n>> hash due to which the alignment of the messages is disturbed like this,\n>>\n>>      3f07dac29 (HEAD -> master) pathspec: don't error out on all-excl...\n>>      ca4a562f2 pathspec magic: add '^' as alias for '!'\n>>      02555c1b2 ls-remote: add \"--diff\" option to show only refs that differ\n>>      6e3a7b339 (tag: v2.12.0-rc0, origin/master, origin/HEAD) Git 2.12-rc0\n>>      fafca0f72 Merge branch 'cw/log-updates-for-all-refs-really'\n>>      74dee5cfa Merge branch 'pl/complete-diff-submodule-diff'\n>>      36acf4123 Merge branch 'rs/object-id'\n>>\n>> And if the decorations were to be shown after the message and you were\n>> checking the logs just to see the status of a branch rather than the\n>> contents then you would again be at a disadvantage, since you would want\n>> to have them visible right next to the hashes. Besides decorations at the\n>> end would have the inconvenience of being truncated at the end of the line\n>> on smaller screens.\n>>\n>> This format for --oneline with decorations was decided upon,\n>>\n>>    b9df16a4c (HEAD -> master)\n>>              pathspec: don't error out on all-exclusionary pathspec patterns\n>>    91a491f05 pathspec magic: add '^' as alias for '!'\n>>    c8e05fd6d ls-remote: add \"--diff\" option to show only refs that differ\n>>    20769079d (tag: v2.12.0-rc2, origin/master, origin/HEAD)\n>>              Git 2.12-rc2\n>>    076c05393 Hopefully the final batch of mini-topics before the final\n> Hmph.  Who decided that such a format is a good idea?  I do not see\n> anything decided positively in the thread [1] you referred to.\n\nOkay, right.\nBut this format does overcome the problems discussed in that thread.\nAnd yes, if `--oneline` is preferred to consume no more than one line,\nthen as you mentioned below, a `--pretty=concise` format seems to be a\ngood idea here.\n\n>> In [2] such formats with date and timestamp are discussed along with\n>> compatibility for --graph option as well,\n>>\n>>    === 2015-09-17 ===\n>>    * ee6ad5f4 12:16 jch (tag: v2.5.3) Git 2.5.3\n>>      === 2015-09-09 ===\n>>    * b9d66899 14:22 js  am --skip/--abort: merge HEAD/ORIG_HEAD tree\n>> into index\n>>    |   === 2015-09-04 ===\n>>    | * 27ea6f85 10:46 jch (tag: v2.5.2) Git 2.5.2\n>>    * 74b67638 10:36 jch (tag: v2.4.9) Git 2.4.9\n>>                         ..........\n>>    * ecad27cf 10:32 jch (tag: v2.3.9) Git 2.3.9\n>>\n>> So these are the two main formats to be enhanced along with as many options\n>> of log as possible. What are your views on this ?\n>>\n> Making the \"--oneline\" format to consume more than one line for a\n> commit is probably not what we want anyway.\n\nFor this format can we build a new option say `--time` or `--log-time`(duh!)\nwhich is compatible only when the other options don't include --notes,\n--pretty or --format(in which case `--log-time` option gets ignored).\nHere I will have to probably build upon Jeff's work to include the\nother options that the script supports too.\n\n> Coming up with a new format (say, \"--pretty=concise\"), or a new\n> option that tweaks the behaviour of \"--oneline\", are possible ways\n> to add a new feature without disrupting existing users' use cases,\n> though.\n>\n> Thanks.\n>\n"},{"id":"393664","messageId":"xmqqh7yh8hdc.fsf@gitster.c.googlers.com","threadId":"53044","inReplyTo":"a67e0d2e-5bcd-8ac7-648e-51c1dc0f72ef@gmail.com","subject":"Re: [GSoC Project RFC] \"git log --oneline\" improvements","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-21T22:37:03Z","receivedAt":"2020-03-21T22:37:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Parth Gala <parthpgala@gmail.com> writes:\n\n>>>    |   === 2015-09-04 ===\n>>>    | * 27ea6f85 10:46 jch (tag: v2.5.2) Git 2.5.2\n>>>    * 74b67638 10:36 jch (tag: v2.4.9) Git 2.4.9\n>>>                         ..........\n>>>    * ecad27cf 10:32 jch (tag: v2.3.9) Git 2.3.9\n>>>\n>>> So these are the two main formats to be enhanced along with as many options\n>>> of log as possible. What are your views on this ?\n>>>\n>> Making the \"--oneline\" format to consume more than one line for a\n>> commit is probably not what we want anyway.\n>\n> For this format can we build a new option say `--time` or `--log-time`(duh!)\n\nMaking such an option orthogonal to the base formats (i.e.\n\"--decorate\" is usable with \"--pretty=short\", \"--pretty=fuller\",\n\"--oneline\", etc.---note that this is not meant to be exhaustive)\nwould be a good idea.  I do not think of any reason why your\n\"--group-by-same-date\" cannot be combined with some of these formats.\n\nIt is reasonable to combine it with \"--format=\"%h %s\", for that\nmatter, because the \"--group-by-same-date\" is not about showing any\nparticular commit but inserting something that does *not* belong to\nany particular commit in between.  Just like \"--graph\" can be\ncombined with many formats, showing group separators in between the\nstream of commits would mix well with any format, I would say.\n\nBy using the idea Peff shown, before starting to emit one commit (in\nany format), you would show a single line of \"== YYYY-MM-DD ==\" if\nthe commit is from a date different from the one that was shown\nlast.  It would naturally extend to \"--group-by-same-month\", etc.,\nso you'd want to be prepared for such future.  Your patch does *not*\nhave to implement such variations like grouping by month, season or\nyear.  But a developer with a good taste would prepare the code in\nsuch a way that is easy to modify to extend the support for such\nvariations by future developers.\n\nAlso remember there are two timestamps, and depending on the use\ncase, people want to see author dates or committer dates.\n\nThanks.\n"}]}