{"thread":{"id":"44319","subject":"Git log exclude/remotes/branches options not working as expected","startedAt":"2016-10-18T13:33:53Z","lastAt":"2016-10-18T17:02:09Z","messageCount":2,"participants":["Robert Dailey","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"304336","messageId":"CAHd499C+SACpBrOEk-V4QMKoq2egmMfYSwUN1tZBBhFOTWomRw@mail.gmail.com","threadId":"44319","inReplyTo":null,"subject":"Git log exclude/remotes/branches options not working as expected","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2016-10-18T13:33:42Z","receivedAt":"2016-10-18T13:33:53Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"I have 3 remotes registered in my clone:\n\norigin, fork, drive\n\nWhen I do:\n\n$ git log --oneline --decorate --graph\n\nI only want to see branches under:\n\nrefs/heads/*\nrefs/remotes/origin/*\n\nI tried the following:\n\n$ git log --oneline --decorate --graph --simplify-by-decoration\n--remote=origin topic1..master\n\nHowever, I still see refs present in the graph for 'drive' and 'fork'\nremote tracking branches. I can't tell if these are shown simply\nbecause other refs not excluded by my options happen to also be at\nthat SHA1, or if the log command is still generating the graph based\non other branches.\n\nWhat I'm expecting is that I literally see NONE of those excluded refs\non the graph, even if other included refs also happen to be positioned\nat those commits. It's the visualization of the refs I'm concerned\nabout: I have a lot of remote tracking branches in those remotes that\nclutter the view; I'd rather not see them at all (in addition to the\ngraph not considering them when it is being built/generated). Am I\nmisunderstanding the purpose here? How can I achieve my goals?\nDocumentation hasn't really helped me out here.\n"},{"id":"304348","messageId":"xmqqzim1pp4m.fsf@gitster.mtv.corp.google.com","threadId":"44319","inReplyTo":"CAHd499C+SACpBrOEk-V4QMKoq2egmMfYSwUN1tZBBhFOTWomRw@mail.gmail.com","subject":"Re: Git log exclude/remotes/branches options not working as expected","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-18T17:02:01Z","receivedAt":"2016-10-18T17:02:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Dailey <rcdailey.lists@gmail.com> writes:\n\n> I have 3 remotes registered in my clone:\n>\n> origin, fork, drive\n>\n> When I do:\n>\n> $ git log --oneline --decorate --graph\n>\n> I only want to see branches under:\n>\n> refs/heads/*\n> refs/remotes/origin/*\n>\n> I tried the following:\n>\n> $ git log --oneline --decorate --graph --simplify-by-decoration\n> --remote=origin topic1..master\n\nI am guessing that the above is not what you actually typed and\ns/remote/remotes/ is what you did.\n\nAccording to \"git log --help\":\n\n    --remotes[=<pattern>]\n        Pretend as if all the refs in refs/remotes are listed on the\n        command line as <commit>. If <pattern> is given, limit\n        remote-tracking branches to ones matching given shell glob. If\n        pattern lacks ?, *, or [, /* at the end is implied.\n\nSo your command line is equivalent to\n\n    $ git log --oneline --decorate --graph --simplify-by-decoration \\\n      refs/remotes/origin/master refs/remotes/origin/topic ... \\\n      topic1..master\n\n(replace the second line with all the remote-tracking branches you\nhave for \"origin\").\n\nThere is nothing that tells \"--decorate\" which refs to base its\ndecoration on, so it is reasonable to expect that a commit that\nhappens to match a tip of remote-tracking branches from other\nremotes are decorated as such, and I think that is what you are\nseeing.\n\n> What I'm expecting is that I literally see NONE of those excluded refs\n> ... How can I achieve my goals?\n\nThe decorations are added in log-tree.c::load_ref_decorations() and\nit does not get anything that says \"I want to see decorations based\non only these refs\", so a short answer is that there is no canned\nway to do this in today's codebase.\n\nHaving said that, I would say it is a reasonable new feature to\nhave.  Another related wishlist item might say \"decorate only based\non tags, not branches or remote-tracking refs\".\n\nYou can achieve your goals by teaching that codepath to take such\nnew pieces of information, come up with a new command line option\n[*1*] and add a code to parse your command line option to either\nbuiltin/log.c or revisions.c and pass it down the callchain that\nleads to load_ref_decorations().\n\n\n[Footnote]\n\n*1* Unfortunately \"--decorate=<option>\" is already taken to specify\nthe decoration levels, so you would need a different one.\n"}]}