{"thread":{"id":"542","subject":"[PATCH Cogito] Add -u option to cg-log to show only commits from a specific user","startedAt":"2005-05-09T00:49:33Z","lastAt":"2005-05-12T20:23:30Z","messageCount":2,"participants":["Marcel Holtmann","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"2846","messageId":"1115599773.8949.90.camel@pegasus","threadId":"542","inReplyTo":null,"subject":"[PATCH Cogito] Add -u option to cg-log to show only commits from a specific user","fromName":"Marcel Holtmann","fromEmail":"marcel@holtmann.org","sentAt":"2005-05-09T00:49:33Z","receivedAt":"2005-05-09T00:49:33Z","isPatch":true,"sender":{"key":"marcel@holtmann.org","avatar":null},"body":"Hi Petr,\n\nthe attached patch introduces the -u option for cg-log. Now you can give\na username or a part of a username and only commits with a matching\nauthor or committer will be displayed.\n\nThis patch also changes the option parsing, because otherwise we are\nstuck to a specific order.\n\nRegards\n\nMarcel\n\n\n\ncg-log: needs update\nIndex: cg-log\n===================================================================\n--- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-log  (mode:100755)\n+++ uncommitted/cg-log  (mode:100755)\n@@ -15,6 +15,9 @@\n #\n # Takes an -f option to list which files was changed.\n #\n+# Takes -u\"username\" to list only commits where author or\n+# committer contains username.\n+#\n # Takes an -r followed with id resolving to a commit to start from\n # (HEAD by default), or id1:id2 representing an (id1;id2] range\n # of commits to show.\n@@ -27,29 +30,39 @@\n # at least somewhere it does. Bash is broken.\n trap exit SIGPIPE\n \n-if [ \"$1\" = \"-c\" ]; then\n-\tshift\n-\t# See terminfo(5), \"Color Handling\"\n-\tcolheader=\"$(tput setaf 2)\"    # Green\n-\tcolauthor=\"$(tput setaf 6)\"    # Cyan\n-\tcolcommitter=\"$(tput setaf 5)\" # Magenta\n-\tcolfiles=\"$(tput setaf 4)\"     # Blue\n-\tcolsignoff=\"$(tput setaf 3)\"   # Yellow\n-\tcoldefault=\"$(tput op)\"        # Restore default\n-else\n-\tcolheader=\n-\tcolauthor=\n-\tcolcommitter=\n-\tcolfiles=\n-\tcolsignoff=\n-\tcoldefault=\n-fi\n-\n+colheader=\n+colauthor=\n+colcommitter=\n+colfiles=\n+colsignoff=\n+coldefault=\n list_files=\n-if [ \"$1\" = \"-f\" ]; then\n-\tshift\n-\tlist_files=1\n-fi\n+user=\n+while [ \"$1\" ]; do\n+\tcase \"$1\" in\n+\t-c)\n+\t\t# See terminfo(5), \"Color Handling\"\n+\t\tcolheader=\"$(tput setaf 2)\"    # Green\n+\t\tcolauthor=\"$(tput setaf 6)\"    # Cyan\n+\t\tcolcommitter=\"$(tput setaf 5)\" # Magenta\n+\t\tcolfiles=\"$(tput setaf 4)\"     # Blue\n+\t\tcolsignoff=\"$(tput setaf 3)\"   # Yellow\n+\t\tcoldefault=\"$(tput op)\"        # Restore default\n+\t\tshift\n+\t\t;;\n+\t-f)\n+\t\tlist_files=1\n+\t\tshift\n+\t\t;;\n+\t-u*)\n+\t\tuser=\"${1#-u}\"\n+\t\tshift\n+\t\t;;\n+\t*)\n+\t\tbreak\n+\t\t;;\n+\tesac\n+done\n \n list_commit_files()\n {\n@@ -109,6 +122,9 @@\n \t\tparent=$(git-cat-file commit $commit | sed -n '2s/parent //p;2Q')\n \t\t[ \"$parent\" ] && [ \"$(git-diff-tree -r $commit $parent \"$@\")\" ] || continue\n \tfi\n+\tif [ \"$user\" ]; then\n+\t\tgit-cat-file commit $commit | grep -e '^author ' -e '^committer ' | grep -qi \"$user\" || continue\n+\tfi\n \techo $colheader\"\"commit ${commit%:*} $coldefault;\n \tgit-cat-file commit $commit | \\\n \t\twhile read key rest; do\n"},{"id":"3190","messageId":"20050512202329.GM324@pasky.ji.cz","threadId":"542","inReplyTo":"1115599773.8949.90.camel@pegasus","subject":"Re: [PATCH Cogito] Add -u option to cg-log to show only commits from a specific user","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-12T20:23:30Z","receivedAt":"2005-05-12T20:23:30Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, May 09, 2005 at 02:49:33AM CEST, I got a letter\nwhere Marcel Holtmann <marcel@holtmann.org> told me that...\n> Hi Petr,\n\nHi,\n\n> the attached patch introduces the -u option for cg-log. Now you can give\n> a username or a part of a username and only commits with a matching\n> author or committer will be displayed.\n> \n> This patch also changes the option parsing, because otherwise we are\n> stuck to a specific order.\n\nI think that one should be in a separate patch.\n\nAt any rate, could you please resend the patch(es) signed off?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"}]}