| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,8 +13,6 @@ General | |||
| 13 | 13 | the std-in command types, as it appears they are not killed when the repo gets | |
| 14 | 14 | deleted. A clear() method could already help to allow long-running programs | |
| 15 | 15 | to remove cached commands after an idle time. | |
| 16 | - * References should be parsed 'manually' to get around command invocation, but | ||
| 17 | - be sure to be able to read packed refs. | ||
| 18 | 16 | ||
| 19 | 17 | Object | |
| 20 | 18 | ------ | |
@@ -83,18 +81,19 @@ Refs | |||
| 83 | 81 | * For performance reasons it would be good to reimplement git-update-ref to be | |
| 84 | 82 | fully equivalent to what the command does. Currently it does some checking and | |
| 85 | 83 | handles symbolic refs as well as normal refs, updating the reflog if required. | |
| 84 | + Its low-priority though as we don't set references directly that often. | ||
| 86 | 85 | * I have read that refs can be symbolic refs as well which would imply the need | |
| 87 | 86 | to possibly dereference them. This makes sense as they originally where possibly | |
| 88 | 87 | a symbolic link. This would mean References could be derived from SymbolicReference | |
| 89 | 88 | officially, but it would still be bad as not all References are symbolic ones. | |
| 90 | 89 | * Making the reflog available as command might be useful actually. This way historical | |
| 91 | 90 | references/commits can be returned. Git internally manages this if refs are specified | |
| 92 | 91 | with HEAD@{0} for instance | |
| 93 | - | ||
| 92 | + * References should be parsed 'manually' to get around command invocation, but | ||
| 93 | + be sure to be able to read packed refs. | ||
| 94 | + | ||
| 94 | 95 | Remote | |
| 95 | 96 | ------ | |
| 96 | - * iter_items should parse the configuration file manually - currently a command | ||
| 97 | - is issued which is much slower than it has to be ( compared to manual parsing ) | ||
| 98 | 97 | * When parsing fetch-info, the regex will not allow spaces in the target remote ref as | |
| 99 | 98 | I couldn't properly parse the optional space separated note in that case. Probably | |
| 100 | 99 | the regex should be improved to handle this gracefully. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -444,10 +444,16 @@ def iter_items(cls, repo): | |||
| 444 | 444 | Returns | |
| 445 | 445 | Iterator yielding Remote objects of the given repository | |
| 446 | 446 | """ | |
| 447 | - seen_remotes = set() | ||
| 448 | - for name in repo.git.remote().splitlines(): | ||
| 449 | - yield Remote(repo, name) | ||
| 450 | - # END for each ref | ||
| 447 | + for section in repo.config_reader("repository").sections(): | ||
| 448 | + print section | ||
| 449 | + if not section.startswith('remote'): | ||
| 450 | + continue | ||
| 451 | + lbound = section.find('"') | ||
| 452 | + rbound = section.rfind('"') | ||
| 453 | + if lbound == -1 or rbound == -1: | ||
| 454 | + raise ValueError("Remote-Section has invalid format: %r" % section) | ||
| 455 | + yield Remote(repo, section[lbound+1:rbound]) | ||
| 456 | + # END for each configuration section | ||
| 451 | 457 | ||
| 452 | 458 | @property | |
| 453 | 459 | def refs(self): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments