{"thread":{"id":"28044","subject":"RFC: repository of handy git aliases?","startedAt":"2011-08-08T04:46:09Z","lastAt":"2011-08-19T06:15:37Z","messageCount":9,"participants":["Jon Seymour","Jakub Narębski","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"173115","messageId":"CAH3AnrpSeWytri-bHEi_9qkAKG1fjL0pVuYFOrrmZumJ6dv_wg@mail.gmail.com","threadId":"28044","inReplyTo":null,"subject":"RFC: repository of handy git aliases?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-08T04:46:09Z","receivedAt":"2011-08-08T04:46:09Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"I was wondering if there is any interest in establishing a wiki page\nor gist repository of git aliases that people find useful?\n\njon.\n"},{"id":"173127","messageId":"CANQwDwfwvaYQt+ck8ky0obyeAa--Wwtdme3UC4vNMFkSiBMq9g@mail.gmail.com","threadId":"28044","inReplyTo":"CAH3AnrpSeWytri-bHEi_9qkAKG1fjL0pVuYFOrrmZumJ6dv_wg@mail.gmail.com","subject":"Re: RFC: repository of handy git aliases?","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2011-08-08T09:45:14Z","receivedAt":"2011-08-08T09:45:14Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:\n> I was wondering if there is any interest in establishing a wiki page\n> or gist repository of git aliases that people find useful?\n\nhttps://git.wiki.kernel.org/index.php/Aliases\n\n-- \nJakub Narebski\n"},{"id":"173128","messageId":"CAH3AnrqEfu1jeCo55bJxLDK8845PsLoZtoT0iWkMUtt1+K9X-w@mail.gmail.com","threadId":"28044","inReplyTo":"CANQwDwfwvaYQt+ck8ky0obyeAa--Wwtdme3UC4vNMFkSiBMq9g@mail.gmail.com","subject":"Re: RFC: repository of handy git aliases?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-08T10:22:04Z","receivedAt":"2011-08-08T10:22:04Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Mon, Aug 8, 2011 at 7:45 PM, Jakub Narębski <jnareb@gmail.com> wrote:\n> On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:\n>> I was wondering if there is any interest in establishing a wiki page\n>> or gist repository of git aliases that people find useful?\n>\n> https://git.wiki.kernel.org/index.php/Aliases\n>\n\nAh, thanks. I added this link\n\n        Aliases - for list of handy tools implemented as git aliases.\n\nto:\n\n       https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools#See_also\n\nsince that is where I expected to find a link when I looked. (Of\ncourse, I should have searched, but I didn't!)\n\njon.\n"},{"id":"173129","messageId":"CAH3AnrrNPBNNNr7Lm2-vnqOisxWorF4FS32H+LBaybWF3KdnGg@mail.gmail.com","threadId":"28044","inReplyTo":"CAH3AnrqEfu1jeCo55bJxLDK8845PsLoZtoT0iWkMUtt1+K9X-w@mail.gmail.com","subject":"Re: RFC: repository of handy git aliases?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-08T10:43:01Z","receivedAt":"2011-08-08T10:43:01Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Mon, Aug 8, 2011 at 8:22 PM, Jon Seymour <jon.seymour@gmail.com> wrote:\n> On Mon, Aug 8, 2011 at 7:45 PM, Jakub Narębski <jnareb@gmail.com> wrote:\n>> On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:\n\nI've also added this...\n\nListing the tips of branches in pu that are not in master\n===========================================\n\nSuppose you have two aliases defined like so:\n\n[alias]\n        oneline = !/usr/bin/xargs -L1 git log --decorate --max-count=1 --oneline\n        tips = \"!_() { t=$(git rev-list --no-merges --max-count=1\n\\\"$@\\\"); if test -n \\\"$t\\\"; then echo $t; _ \\\"$@\\\" ^$t; fi; }; _\"\n\nThen:\n\ngit tips origin/pu ^origin/next | git oneline\n\nmight show something like this:\n\n9dcca58 filter-branch.sh: de-dent usage string\n704c335 On Cygwin support both UNIX and DOS style path-names\n1c460f9 t3030: fix accidental success in symlink rename\n9e81372 test-path-utils: Add subcommand \"prefix_path\"\nad733bd revert: Propagate errors upwards from do_pick_commit\n76cf946 fixup! xdiff/xhistogram: rework handling of recursed results\ndf6a9c7 fixup! describe: Refresh the index when run with --dirty\nc9f57a0 squash! ls-files: fix pathspec display on error\na1288bc add--interactive: add option to autosplit hunks\n365b78a t5800: point out that deleting branches does not work\nc997182 limit \"contains\" traversals based on commit generation\n914b6fb doc/fast-import: document feature import-marks-if-exists\nb792c06 branch -v: honor core.abbrev\nb166408 mergetool: Don't assume paths are unmerged\nb29d76f merge: mark the final \"Merge made by...\" message for l10n\n942cf39 receive-pack: Allow server to refuse pushes with too many objects\n\nwhich is a list of the tips of branches that are in pu, but not in next.\n"},{"id":"173130","messageId":"CAH3Anrqx9moqpwLu8qAvam7o8RPiCo4TkojtqnDvjHpftb+mEA@mail.gmail.com","threadId":"28044","inReplyTo":"CAH3AnrrNPBNNNr7Lm2-vnqOisxWorF4FS32H+LBaybWF3KdnGg@mail.gmail.com","subject":"Re: RFC: repository of handy git aliases?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-08T10:45:10Z","receivedAt":"2011-08-08T10:45:10Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Mon, Aug 8, 2011 at 8:43 PM, Jon Seymour <jon.seymour@gmail.com> wrote:\n> On Mon, Aug 8, 2011 at 8:22 PM, Jon Seymour <jon.seymour@gmail.com> wrote:\n>> On Mon, Aug 8, 2011 at 7:45 PM, Jakub Narębski <jnareb@gmail.com> wrote:\n>>> On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:\n>\n> I've also added this...\n>\n> Listing the tips of branches in pu that are not in master\n> ===========================================\n>\n\nmaster -> next\n"},{"id":"173610","messageId":"4E4A76E7.2090100@drmicha.warpmail.net","threadId":"28044","inReplyTo":"CAH3AnrrNPBNNNr7Lm2-vnqOisxWorF4FS32H+LBaybWF3KdnGg@mail.gmail.com","subject":"Re: RFC: repository of handy git aliases?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-08-16T13:55:51Z","receivedAt":"2011-08-16T13:55:51Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jon Seymour venit, vidit, dixit 08.08.2011 12:43:\n> On Mon, Aug 8, 2011 at 8:22 PM, Jon Seymour <jon.seymour@gmail.com> wrote:\n>> On Mon, Aug 8, 2011 at 7:45 PM, Jakub Narębski <jnareb@gmail.com> wrote:\n>>> On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:\n> \n> I've also added this...\n> \n> Listing the tips of branches in pu that are not in master\n> ===========================================\n> \n> Suppose you have two aliases defined like so:\n> \n> [alias]\n>         oneline = !/usr/bin/xargs -L1 git log --decorate --max-count=1 --oneline\n\nHow about\n\noneline = git log --no-walk --decorate --oneline\n\n>         tips = \"!_() { t=$(git rev-list --no-merges --max-count=1\n> \\\"$@\\\"); if test -n \\\"$t\\\"; then echo $t; _ \\\"$@\\\" ^$t; fi; }; _\"\n> \n\nThat one is way over my head, but if\n\n> Then:\n> \n> git tips origin/pu ^origin/next | git oneline\n\nis your typical use case you may like\n\ngit branch --merged origin/pu --contains origin/next\n\n(or with --no-merged, but put it first.)\n\n> might show something like this:\n> \n> 9dcca58 filter-branch.sh: de-dent usage string\n> 704c335 On Cygwin support both UNIX and DOS style path-names\n> 1c460f9 t3030: fix accidental success in symlink rename\n> 9e81372 test-path-utils: Add subcommand \"prefix_path\"\n> ad733bd revert: Propagate errors upwards from do_pick_commit\n> 76cf946 fixup! xdiff/xhistogram: rework handling of recursed results\n> df6a9c7 fixup! describe: Refresh the index when run with --dirty\n> c9f57a0 squash! ls-files: fix pathspec display on error\n> a1288bc add--interactive: add option to autosplit hunks\n> 365b78a t5800: point out that deleting branches does not work\n> c997182 limit \"contains\" traversals based on commit generation\n> 914b6fb doc/fast-import: document feature import-marks-if-exists\n> b792c06 branch -v: honor core.abbrev\n> b166408 mergetool: Don't assume paths are unmerged\n> b29d76f merge: mark the final \"Merge made by...\" message for l10n\n> 942cf39 receive-pack: Allow server to refuse pushes with too many objects\n> \n> which is a list of the tips of branches that are in pu, but not in next.\n\nThat's not quite the standard --decorate, is it? ;)\n\nMichael\n"},{"id":"173761","messageId":"CAH3AnrpahkHtnu5QTRns-vVcCoj3Q8JM-mzytYF2ZC_EXjU7Xw@mail.gmail.com","threadId":"28044","inReplyTo":"4E4A76E7.2090100@drmicha.warpmail.net","subject":"Re: RFC: repository of handy git aliases?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-18T14:52:22Z","receivedAt":"2011-08-18T14:52:22Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Tue, Aug 16, 2011 at 11:55 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Jon Seymour venit, vidit, dixit 08.08.2011 12:43:\n>> On Mon, Aug 8, 2011 at 8:22 PM, Jon Seymour <jon.seymour@gmail.com> wrote:\n>>> On Mon, Aug 8, 2011 at 7:45 PM, Jakub Narębski <jnareb@gmail.com> wrote:\n>>>> On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:\n>>\n>> I've also added this...\n>>\n>> Listing the tips of branches in pu that are not in master\n>> ===========================================\n>>\n>> Suppose you have two aliases defined like so:\n>>\n>> [alias]\n>>         oneline = !/usr/bin/xargs -L1 git log --decorate --max-count=1 --oneline\n>\n> How about\n>\n> oneline = git log --no-walk --decorate --oneline\n\nI still need to !/usr/bin/xargs -L1m, don't I? The point is to\ntransform a list of SHA1s into a decorated list. But point taken about\n--no-walk being an alternative to --max-count=1.\n\n> git branch --merged origin/pu --contains origin/next\n>\n> (or with --no-merged, but put it first.)\n>\n\nSo, the idea with tips is that it will show you the tips of\nindependent lines of development that have diverged from origin/next\n(or before) that have been merged back into origin/pu. This works,\neven if you don't have branches assigned to these tips.\n\nIn this example:\n\nA-----B---E---F---G---H\n\\-----C--/   /\n \\ ----D----/\n\ngit tips F will show B, C, D as the tips of branches that have\ndiverged from the mainline but have merged back in.\n\nIf I want to rebuild F' which does not include C, then git tips F\ntells me that I have to merge B and D.\n\nThe git tips alias abstracts the function of 'git work list\ndependency' which is a function of git extension (git work) that I\nhave been playing around with for a while.\n\nI use git work to manage a private integration branch which includes\nall my current published but unintegrated-upstream topics. If I decide\nI want to unmerge one of these topics from my integration branch, I'd\ndo something like:\n\n     git work unmerge C\n\nWhich does the equivalent of:\n\n   git checkout B\n   git merge D\n   git rebase --onto HEAD F H\n\n\n>>\n>> which is a list of the tips of branches that are in pu, but not in next.\n>\n> That's not quite the standard --decorate, is it? ;)\n>\n\nNot sure what you mean by not being standard? The main idea about\nusing --decorate here is to get a dump of any refs that might describe\nthe identified tips.\n\njon.\n"},{"id":"173763","messageId":"4E4D3281.2050600@drmicha.warpmail.net","threadId":"28044","inReplyTo":"CAH3AnrpahkHtnu5QTRns-vVcCoj3Q8JM-mzytYF2ZC_EXjU7Xw@mail.gmail.com","subject":"Re: RFC: repository of handy git aliases?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-08-18T15:40:49Z","receivedAt":"2011-08-18T15:40:49Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jon Seymour venit, vidit, dixit 18.08.2011 16:52:\n> On Tue, Aug 16, 2011 at 11:55 PM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Jon Seymour venit, vidit, dixit 08.08.2011 12:43:\n>>> On Mon, Aug 8, 2011 at 8:22 PM, Jon Seymour <jon.seymour@gmail.com> wrote:\n>>>> On Mon, Aug 8, 2011 at 7:45 PM, Jakub Narębski <jnareb@gmail.com> wrote:\n>>>>> On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:\n>>>\n>>> I've also added this...\n>>>\n>>> Listing the tips of branches in pu that are not in master\n>>> ===========================================\n>>>\n>>> Suppose you have two aliases defined like so:\n>>>\n>>> [alias]\n>>>         oneline = !/usr/bin/xargs -L1 git log --decorate --max-count=1 --oneline\n>>\n>> How about\n>>\n>> oneline = git log --no-walk --decorate --oneline\n> \n> I still need to !/usr/bin/xargs -L1m, don't I? The point is to\n> transform a list of SHA1s into a decorated list. But point taken about\n> --no-walk being an alternative to --max-count=1.\n\nIs this a typo or do you have an xargs which understands \"1m\"? My point\nwas that you can feed all tips to \"log\" at once, as long as you don't\nexceed the argument list limits, of course.\n\n>> git branch --merged origin/pu --contains origin/next\n>>\n>> (or with --no-merged, but put it first.)\n>>\n> \n> So, the idea with tips is that it will show you the tips of\n> independent lines of development that have diverged from origin/next\n> (or before) that have been merged back into origin/pu. This works,\n> even if you don't have branches assigned to these tips.\n\nOK, that is different then.\n\n[snipped discription]\n> \n> \n\n[readding relevant part:]\n>>> b166408 mergetool: Don't assume paths are unmerged\n>>> b29d76f merge: mark the final \"Merge made by...\" message for l10n\n>>>942cf39 receive-pack: Allow server to refuse pushes with too many objects\n\n>>>\n>>> which is a list of the tips of branches that are in pu, but not in next.\n>>\n>> That's not quite the standard --decorate, is it? ;)\n>>\n> \n> Not sure what you mean by not being standard? The main idea about\n> using --decorate here is to get a dump of any refs that might describe\n> the identified tips.\n\nJust compare your output with this:\n\ngit log --decorate --no-walk --oneline origin/{master,next,pu}\na46e511 (origin/pu) Merge branch 'fg/submodule-git-file-git-dir' into pu\n\n0e3f8f0 (origin/next) Merge branch 'master' into next\n\n4bfe7cb (origin/master, origin/HEAD) Sync with \"maint\"\n\nThat is, I get the branch decorations there; you use the same format but\ndon't get any. But I may be misunderstanding completely what you are\ntrying to achieve. I guess I have to reread your extended use case\ndescription...\n\nCheers,\nMichael\n"},{"id":"173837","messageId":"CAH3AnrpBE+xDfQ=mPDcFRx+C+b9SHS7T9njA8A6Xu4m82vu1Xw@mail.gmail.com","threadId":"28044","inReplyTo":"4E4D3281.2050600@drmicha.warpmail.net","subject":"Re: RFC: repository of handy git aliases?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-19T06:15:37Z","receivedAt":"2011-08-19T06:15:37Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Fri, Aug 19, 2011 at 1:40 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Is this a typo or do you have an xargs which understands \"1m\"? My point\n> was that you can feed all tips to \"log\" at once, as long as you don't\n> exceed the argument list limits, of course.\n\nYeah, meant -L1, not -L1m.\n\nOk, so you are suggesting something like: git oneline $(git tips\norigin/pu ^ origin/next) instead of\n\n    git tips origin/pu ^origin/next | git oneline\n\nI guess it comes down to a preference thing, but it is good to know\nthat with --no-walk I can do it either way, so thanks!\n\nHere's a alias definition for oneline that does it both ways,\ndepending on preference...\n\n[alias]\n        oneline =\"!_() { if test $# -eq 0; then xargs -L1 git log\n--no-walk --decorate --oneline; else git log --no-walk --decorate\n--oneline \\\"$@\\\"; fi; }; _\"\n\n>>\n>> Not sure what you mean by not being standard? The main idea about\n>> using --decorate here is to get a dump of any refs that might describe\n>> the identified tips.\n>\n> Just compare your output with this:\n>\n> git log --decorate --no-walk --oneline origin/{master,next,pu}\n> a46e511 (origin/pu) Merge branch 'fg/submodule-git-file-git-dir' into pu\n>\n> 0e3f8f0 (origin/next) Merge branch 'master' into next\n>\n> 4bfe7cb (origin/master, origin/HEAD) Sync with \"maint\"\n>\n> That is, I get the branch decorations there; you use the same format but\n> don't get any. But I may be misunderstanding completely what you are\n> trying to achieve. I guess I have to reread your extended use case\n> description...\n>\n\nOk, so the only reason my output didn't show any tags is that there\ndidn't happen to be any.\n\nWith a local integration branch, there usually will be local\nreferences that explain each tip. So, for example, git tips master for\nme currently shows:\n\ngit tips master | git oneline  shows:\n\nf85a051 (kernel/master) Update draft release notes to 1.7.7\n9e90d12 (refactor) rename auto-edit -> refactor.\ne586f2e (gitwork-dist) Regenerate git-work.zip\ndbb64d9 (tag: gitwork-v0.0.11, public/gitwork, gitwork) git-work:\nupdate documentation.\n272277f (bisect-gettextln) bisect: take advantage of gettextln, eval_gettextln.\n\nSo this does show helpful decorations. The reason git tips origin/pu\n^origin/next | git oneline doesn't show any decorations is simply\nbecause I don't have any tags or branches that represent those tips -\nJunio presumably does, for example.\n\nNote also that git tips doesn't show merge commits.\n\nThe best way to understand what git tips does is to do this:\n\n     gitk origin/pu ^origin/next --no-merges\n\nThe commits reported by git tips are the tips of each linear stream of\ndevelopment you see in gitk.\n\njon.\n"}]}