Avoid git fetch'ing all branches by default#469
Avoid git fetch'ing all branches by default#469hjwp wants to merge 2 commits intoremotemobprogramming:mainfrom
Conversation
On a repo with a significant number of remote branches, fetching all remotes takes a substantial amount of time (literal minutes in our case, with thousands of remotes) This changes each `git fetch` call to fetch only the current branch name.
…avoids git remote does not exist error) Following on from the previous change, we do not want to do a `git fetch mybranch` if we know the branch is not going to exist, ie in the case where we are doing `--create`.
|
Hi thank you for your contribution. The tests do not successfully complete. But I even think that just fetching the current branch is not a solution. At least you would have to check for the correlated mob branch if you are on a base branch and vice versa. And even then I am not sure if that would work right now. Could you explain to me why the repo of your Project has so many things that get fetched? I want to understand the background behind it. |
|
thanks for taking an interest! the repo i'm working on currently has over 4000 open branches, and by way of example, had 178 merges in the last 4 hours, ie 178 branches closed/deleted. that makes the overhead of an unqualified |
|
sorry for not finding the tests! I've never written any Go before so i'm finding my feet.
can you tell me a bit more about why it wouldn't work? |
On a repo with a significant number of remote branches, fetching all remotes takes a substantial amount of time (literal minutes in our case where there are thousands of remotes)
This changes each
git fetchcall to fetch only the current branch name, and has specialcase handling for themob start --createoption where we know we want to create a brand new branch.Appreciate this might not be a problem for most people!