Handle empty issue list more gently + avoid fetching the git remote directly#217
Conversation
|
Darn, looking at it more closely it looks like the remote name is both assumed in the program to be |
changed.d
Outdated
| auto cmd = ["git", "-C", repo, "fetch", "upstream", "--tags"]; | ||
| // ensure that changed_upstream exists (we ignore failures) | ||
| auto cmd = ["git", "-C", repo, "remote", "add", "changed_upstream", "https://github.com/dlang/" ~ repo.baseName]; | ||
| execute(cmd); |
There was a problem hiding this comment.
We can fetch directly without adding a remote:
cmd = ["git", "-C", repo, "fetch", "--tags", "https://github.com/dlang/" ~ repo.baseName, "+refs/heads/*:refs/remotes/upstream/*", "--tags"];
This avoids adding a remote and preserves compatibility with the existing command-line usage (specifying upstream/ before branch names), though it will overwrite the tracking refs of whatever remote the user has that's named upstream, assuming one exists.
Git namespaces seem to allow fixing everything at once, though.
I think you meant remote, not branch |
With that and @MartinNowak's approval, I think this will be good to go. |
f17490e to
e049894
Compare
Can't we do this directly in the
Nice!
Rebased and waiting for approval. |
Sure, but you'll need to do this for all git invocations. |
| auto p = pipeProcess(cmd, Redirect.stdout, ["GIT_NAMESPACE": "changed"]); | ||
| enforce(wait(p.pid) == 0, "Failed to execute '%(%s %)'.".format(cmd)); | ||
|
|
||
| cmd = ["git", "-C", repo, "log", revRange]; |
There was a problem hiding this comment.
This needs to have the GIT_NAMESPACE thing too, otherwise it won't use the correct refs. Right?
|
If you want to avoid changing the environment, there's also |
Use a git NAMESPACE to avoid interference with the user's refs.
e049894 to
97253e9
Compare
|
Okay so I gave this another try locally with: And (I set However, within the list of remote branches the just fetched branches appear: I also tried it manually - with the same effect: I am not sure whether this is a potential issue for the few people that use |
|
What the heck. I can't get it to work either. |
I'm sorry, I must have confused it with something else :( |
|
OK, I say to just drop the entire namespace thing then. The fetching without creating a remote is good enough by itself. |
FWIW I think that for the few people that use this script (currently only @MartinNowak), it won't matter anyways. Imho the most important thing is that it's displated on DAutoTest ;-) |
Okay - done :) |
|
LGTM |
When there are no issues in the git log, the bugzilla query is empty and thus all issues get loaded. This is fix that solves the problem by simply returning earlier and thus not sending the Bugzilla query.
Also there's also the category "VisualD" on Bugzilla into which on might run as well (even though it's currently not on list of parsed repos).
Moreover, as dlang.org changelog scheme is without "v", there's another simple fix that prints the previous version with the "v" prefix.