Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

improve refs handling #1246

merged 8 commits into from Feb 22, 2014


None yet
1 participant

tarsius commented Feb 22, 2014

Also see #1220.

tarsius added some commits Feb 22, 2014

@tarsius tarsius magit-list-{refs,refnames,{*}branch{*}}: new functions 8ca0b21
@tarsius tarsius magit-get-ref: rename argument REF to NAME 7e59cc4
@tarsius tarsius magit-get-refname: new function 4c7e88d
@tarsius tarsius magit-get-shortname: new function, replacing magit-name-rev 4085769
@tarsius tarsius magit-unambiguous-refname-p: new function
This replaces `magit-ref-ambiguous-p'; the input isn't
necessarily a ref and we should assert "the good case".
@tarsius tarsius magit-rev-parse: accept any number of arguments 5afdef6
@tarsius tarsius magit-rev-parse-p: new function 318edef
@tarsius tarsius magit-list-interesting-refs: remove function and related crap
Instead use the recently added `magit-list-refnames'.

This is (only) the starting point to implement more meaningful revision
and reference completion.  `magit-list-interesting-refs' was very very
bad.  Basically it and the code which surrounded it (not all of which
has been replaced yet) took the "when in doubt, pick the worst possible
option" approach.  E.g. instead of asking "what do we have to complete?"
and answering that with (in nine out of ten cases) "branches", and then
going on to "how do we get a list of branches?"; what we actually did
was "find some git command that gives us a list of refs, pick the first
one, it doesn't matter whether there are better ones", then start using
it, notice that the completion candidates contain many refs that we are
not interested in, implement "filter out the uninteresting refs", and
then keep on complicating things, making it less and less likely that
this will ever be fixed.  Well, I have had it, this crap has to go.

@tarsius tarsius merged commit d1d315f into next Feb 22, 2014

@tarsius tarsius deleted the n/refs-1 branch Feb 22, 2014

@tarsius tarsius added this to the 2.1.0 milestone Feb 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment