|
|
DescriptionAdd 'git cache fetch' subcommand.
If you're in a git checkout cloned from the git cache, this will:
- Update the cache with the latest upstream commits.
- Update the cwd with the latest commits from the cache.
For example:
> cd $HOME/workspace/chromium/src
> git cache fetch
R=agable@chromium.org,iannucci@chromium.org
BUG=
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=288140
Patch Set 1 #
Total comments: 5
Patch Set 2 : #Patch Set 3 : #Messages
Total messages: 12 (0 generated)
like the idea :) https://codereview.chromium.org/440213005/diff/1/git_cache.py File git_cache.py (right): https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode582 git_cache.py:582: current_branch = subprocess.check_output( won't this need to go up all the way to the rootmost branch, if you have local tracking branches? https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode588 git_cache.py:588: if upstream: local branches will have an upstream of '.'
https://codereview.chromium.org/440213005/diff/1/git_cache.py File git_cache.py (right): https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode582 git_cache.py:582: current_branch = subprocess.check_output( On 2014/08/07 18:29:53, iannucci wrote: > won't this need to go up all the way to the rootmost branch, if you have local > tracking branches? git doesn't behave that way; it only looks at the currently-checked-out-branch. I think. https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode588 git_cache.py:588: if upstream: On 2014/08/07 18:29:53, iannucci wrote: > local branches will have an upstream of '.' Fixed.
https://codereview.chromium.org/440213005/diff/1/git_cache.py File git_cache.py (right): https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode582 git_cache.py:582: current_branch = subprocess.check_output( On 2014/08/07 18:32:53, szager1 wrote: > On 2014/08/07 18:29:53, iannucci wrote: > > won't this need to go up all the way to the rootmost branch, if you have local > > tracking branches? > > git doesn't behave that way; it only looks at the currently-checked-out-branch. > I think. Also, I think the degenerate base case will work fine for pretty much everyone: no remote is specified, it fetches 'origin'.
On 2014/08/07 18:32:54, szager1 wrote: > https://codereview.chromium.org/440213005/diff/1/git_cache.py > File git_cache.py (right): > > https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode582 > git_cache.py:582: current_branch = subprocess.check_output( > On 2014/08/07 18:29:53, iannucci wrote: > > won't this need to go up all the way to the rootmost branch, if you have local > > tracking branches? > > git doesn't behave that way; it only looks at the currently-checked-out-branch. > I think. > Oh, sure... Yeah, I guess so. That just means that it'll guess origin though, right? I'm thinking: other_remote/master foobar my_cool_branch * origin/master master If we're on my_cool_branch, we'll want to fetch other_remote (sensible), or the configured global fetch specs (what `git fetch` does). But I think right now, it'll fetch origin? > https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode588 > git_cache.py:588: if upstream: > On 2014/08/07 18:29:53, iannucci wrote: > > local branches will have an upstream of '.' > > Fixed.
On 2014/08/07 18:40:21, iannucci wrote: > On 2014/08/07 18:32:54, szager1 wrote: > > https://codereview.chromium.org/440213005/diff/1/git_cache.py > > File git_cache.py (right): > > > > https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode582 > > git_cache.py:582: current_branch = subprocess.check_output( > > On 2014/08/07 18:29:53, iannucci wrote: > > > won't this need to go up all the way to the rootmost branch, if you have > local > > > tracking branches? > > > > git doesn't behave that way; it only looks at the > currently-checked-out-branch. > > I think. > > > > Oh, sure... Yeah, I guess so. That just means that it'll guess origin though, > right? I'm thinking: > > other_remote/master > foobar > my_cool_branch * > > origin/master > master > > If we're on my_cool_branch, we'll want to fetch other_remote (sensible), or the > configured global fetch specs (what `git fetch` does). But I think right now, > it'll fetch origin? Correct, but how likely is that scenario?
On 2014/08/07 18:51:05, szager1 wrote: > On 2014/08/07 18:40:21, iannucci wrote: > > On 2014/08/07 18:32:54, szager1 wrote: > > > https://codereview.chromium.org/440213005/diff/1/git_cache.py > > > File git_cache.py (right): > > > > > > https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode582 > > > git_cache.py:582: current_branch = subprocess.check_output( > > > On 2014/08/07 18:29:53, iannucci wrote: > > > > won't this need to go up all the way to the rootmost branch, if you have > > local > > > > tracking branches? > > > > > > git doesn't behave that way; it only looks at the > > currently-checked-out-branch. > > > I think. > > > > > > > Oh, sure... Yeah, I guess so. That just means that it'll guess origin though, > > right? I'm thinking: > > > > other_remote/master > > foobar > > my_cool_branch * > > > > origin/master > > master > > > > If we're on my_cool_branch, we'll want to fetch other_remote (sensible), or > the > > configured global fetch specs (what `git fetch` does). But I think right now, > > it'll fetch origin? > > Correct, but how likely is that scenario? Well... I use stacked branches all the time, so > 0.0, <= 1.0, but I don't have more data than that.
lgtm, could you just add a TODO about stacked branches for now?
On 2014/08/07 20:26:46, iannucci wrote: > On 2014/08/07 18:51:05, szager1 wrote: > > On 2014/08/07 18:40:21, iannucci wrote: > > > On 2014/08/07 18:32:54, szager1 wrote: > > > > https://codereview.chromium.org/440213005/diff/1/git_cache.py > > > > File git_cache.py (right): > > > > > > > > https://codereview.chromium.org/440213005/diff/1/git_cache.py#newcode582 > > > > git_cache.py:582: current_branch = subprocess.check_output( > > > > On 2014/08/07 18:29:53, iannucci wrote: > > > > > won't this need to go up all the way to the rootmost branch, if you have > > > local > > > > > tracking branches? > > > > > > > > git doesn't behave that way; it only looks at the > > > currently-checked-out-branch. > > > > I think. > > > > > > > > > > Oh, sure... Yeah, I guess so. That just means that it'll guess origin > though, > > > right? I'm thinking: > > > > > > other_remote/master > > > foobar > > > my_cool_branch * > > > > > > origin/master > > > master > > > > > > If we're on my_cool_branch, we'll want to fetch other_remote (sensible), or > > the > > > configured global fetch specs (what `git fetch` does). But I think right > now, > > > it'll fetch origin? > > > > Correct, but how likely is that scenario? > > Well... I use stacked branches all the time, so > 0.0, <= 1.0, but I don't have > more data than that. Is your remote named 'origin'? If so, then this still WAI. That's what I mean by the degenerate base case: if all else fails, try remote 'origin'. That should work for just about everyone.
The CQ bit was checked by szager@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/szager@chromium.org/440213005/40001
Message was sent while issue was closed.
Change committed as 288140 |