{"thread":{"id":"50487","subject":"Feature request on git log --oneline <revision range> -- <path>...","startedAt":"2019-02-13T04:57:15Z","lastAt":"2019-02-13T21:09:37Z","messageCount":4,"participants":["Petri Gynther","Ævar Arnfjörð Bjarmason","Duy Nguyen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"369207","messageId":"CAGXr9JHb1hjtMamdWt=oDg_eeBEuiDcbzAx+1XpV+HvvX1xsaA@mail.gmail.com","threadId":"50487","inReplyTo":null,"subject":"Feature request on git log --oneline <revision range> -- <path>...","fromName":"Petri Gynther","fromEmail":"pgynther@google.com","sentAt":"2019-02-13T04:57:01Z","receivedAt":"2019-02-13T04:57:15Z","isPatch":false,"sender":{"key":"pgynther@google.com","avatar":null},"body":"git developers:\n\nSmall feature request on:\ngit log --oneline <revision range> -- <path>...\n\nCould we add an option to:\n1) display all commits in <revision range> unconditionally\n2) use a special marker (e.g. star) for commits that touch <path>...\nand list the files from <path>... that this commit modified\n\nSample output:\ngit log --oneline (--annotated?) HEAD~5..HEAD -- Makefile kernel/printk/printk.c\n\n  aaaabbbbccc1 uninteresting commit 1\n* aaaabbbbccc2 fix Makefile\n    Makefile\n  aaaabbbbccc3 uninteresting commit 2\n* aaaabbbbccc4 fix Makefile and printk()\n    Makefile\n    kernel/printk/printk.c\n  aaaabbbbccc5 uninteresting commit 3\n\nIn other words:\n- commits that don't touch <path>... are still listed (without special markers)\n- commits that touch <path>... are listed with * prefix, and the files\nfrom <path>... that the commit modified are listed below the commit\n\nThis is very useful for kernel LTS merges, when we want to know which\nLTS patches in the merge chain actually touched the files that matter\nfor a specific build target.\n\nIs this an easy add-on to git log?\n"},{"id":"369225","messageId":"87k1i4j8aj.fsf@evledraar.gmail.com","threadId":"50487","inReplyTo":"CAGXr9JHb1hjtMamdWt=oDg_eeBEuiDcbzAx+1XpV+HvvX1xsaA@mail.gmail.com","subject":"Re: Feature request on git log --oneline <revision range> -- <path>...","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-02-13T10:24:04Z","receivedAt":"2019-02-13T10:24:09Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Feb 13 2019, Petri Gynther wrote:\n\n> git developers:\n>\n> Small feature request on:\n> git log --oneline <revision range> -- <path>...\n>\n> Could we add an option to:\n> 1) display all commits in <revision range> unconditionally\n> 2) use a special marker (e.g. star) for commits that touch <path>...\n> and list the files from <path>... that this commit modified\n>\n> Sample output:\n> git log --oneline (--annotated?) HEAD~5..HEAD -- Makefile kernel/printk/printk.c\n>\n>   aaaabbbbccc1 uninteresting commit 1\n> * aaaabbbbccc2 fix Makefile\n>     Makefile\n>   aaaabbbbccc3 uninteresting commit 2\n> * aaaabbbbccc4 fix Makefile and printk()\n>     Makefile\n>     kernel/printk/printk.c\n>   aaaabbbbccc5 uninteresting commit 3\n>\n> In other words:\n> - commits that don't touch <path>... are still listed (without special markers)\n> - commits that touch <path>... are listed with * prefix, and the files\n> from <path>... that the commit modified are listed below the commit\n>\n> This is very useful for kernel LTS merges, when we want to know which\n> LTS patches in the merge chain actually touched the files that matter\n> for a specific build target.\n\nWhat do you think such an option should do when it finds negative path\nspecs, e.g. this on git.git:\n\n    git log --oneline --stat -- ':!/Makefile' '*Makefile*'\n\nShould it only render positive matches, or distinguish between\nmatched/blacklisted/not-matched, your example (with no negative\npatspecs) just shows matched/not-matched.\n\n> Is this an easy add-on to git log?\n\nIt's been a while since I looked at this code, but (depending on the\nanswer to the above) I don't think it would be that hard. We already\npass up what we matched for the --stat machinery. E.g. try on git.git:\n\n    git log --oneline -1 --stat 32ceace39f --\n    git log --oneline -1 --stat 32ceace39f -- '*fetch.c'\n\nThe former shows a few modified *.c files in the --stat, the latter just\nbuiltin/fetch.c since it matched.\n"},{"id":"369230","messageId":"CACsJy8D2B_6yvBAQSeh3gvYHLOdfLmgiZ5Z=f4ZGeJ891X4Zjw@mail.gmail.com","threadId":"50487","inReplyTo":"CAGXr9JHb1hjtMamdWt=oDg_eeBEuiDcbzAx+1XpV+HvvX1xsaA@mail.gmail.com","subject":"Re: Feature request on git log --oneline <revision range> -- <path>...","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-02-13T12:31:21Z","receivedAt":"2019-02-13T12:31:50Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Feb 13, 2019 at 4:27 PM Petri Gynther <pgynther@google.com> wrote:\n>\n> git developers:\n>\n> Small feature request on:\n> git log --oneline <revision range> -- <path>...\n>\n> Could we add an option to:\n> 1) display all commits in <revision range> unconditionally\n> 2) use a special marker (e.g. star) for commits that touch <path>...\n> and list the files from <path>... that this commit modified\n>\n> Sample output:\n> git log --oneline (--annotated?) HEAD~5..HEAD -- Makefile kernel/printk/printk.c\n>\n>   aaaabbbbccc1 uninteresting commit 1\n> * aaaabbbbccc2 fix Makefile\n>     Makefile\n>   aaaabbbbccc3 uninteresting commit 2\n> * aaaabbbbccc4 fix Makefile and printk()\n>     Makefile\n>     kernel/printk/printk.c\n>   aaaabbbbccc5 uninteresting commit 3\n>\n> In other words:\n> - commits that don't touch <path>... are still listed (without special markers)\n> - commits that touch <path>... are listed with * prefix, and the files\n> from <path>... that the commit modified are listed below the commit\n>\n> This is very useful for kernel LTS merges, when we want to know which\n> LTS patches in the merge chain actually touched the files that matter\n> for a specific build target.\n>\n> Is this an easy add-on to git log?\n\nAdding the \"*\" is not that hard, I think. The hard part is UI. Soon\nsomebody may want to \"list commits touching sub/ then add \"*\" on ones\nthat touch sub/dir/\". Meanwhile I think you can still achieve that\nwith a bit of scripting and processing \"git log --raw --oneline\n<revisions>\" output.\n-- \nDuy\n"},{"id":"369255","messageId":"xmqqmumzbdki.fsf@gitster-ct.c.googlers.com","threadId":"50487","inReplyTo":"87k1i4j8aj.fsf@evledraar.gmail.com","subject":"Re: Feature request on git log --oneline <revision range> -- <path>...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-13T21:09:33Z","receivedAt":"2019-02-13T21:09:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> What do you think such an option should do when it finds negative path\n> specs, e.g. this on git.git:\n>\n>     git log --oneline --stat -- ':!/Makefile' '*Makefile*'\n>\n> Should it only render positive matches, or distinguish between\n> matched/blacklisted/not-matched, your example (with no negative\n> patspecs) just shows matched/not-matched.\n\nAnother thing to consider is what this would do to the merge\nsimplification.\n\nIf I understand it correctly, this is sort-of like a reverse of the\n\"--full-diff\" option, where the pathspec *is* used to limit and\nsimplify the history, but for the purpose of displaying \"log -p\"\noutput, the pathspec is widened to show the entire change.  This\ninstead makes the traversal ignore the pathspec and uses it only to\nlimit the \"log -p\" output.  I do not think I would be fundamentally\nopposed to a feature like this.\n\n"}]}