Closed
Bug 1203686
Opened 9 years ago
Closed 9 years ago
Add git support to mach try's "find files changed in the current branch" feature
Categories
(Testing :: General, defect)
Testing
General
Tracking
(firefox44 fixed)
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: chmanchester, Assigned: chmanchester)
References
Details
Attachments
(1 file)
There's a plausible approach thanks to :jgraham based on git branch -a --contains and git ref-list, but according to http://marc.info/?l=git&m=143218896817198&w=2 and other threads on the list both of these commands are likely to fail on repositories like mozilla-central, where subsequent commits frequently have non-increasing commit dates.
There are probably a few more ideas that might work, we can discuss here.
Assignee | ||
Comment 1•9 years ago
|
||
My current idea is:
Get all branches with git branch -a.
For each branch that isn't the current branch, find git merge-base HEAD $branch.
Run git log --topo-order and iterate over the results in order and find the first commit that's also a merge-base.
Run git diff --name-only with this commit.
It's very slow, but I can't think of a way it would break.
Comment 2•9 years ago
|
||
git merge-base HEAD $(git branch -a) might actually work to find the right base commit for the diff
Comment 3•9 years ago
|
||
(with the asterisk removed from git branch -a)
Comment 4•9 years ago
|
||
Err, another shortcoming of git branch -a: it shows symbolic refs like "remotes/origin/HEAD -> origin/master"
Assignee | ||
Comment 5•9 years ago
|
||
Thanks glandium, I didn't notice merge-base works with more than two commits. Filtering the output of for-each-ref should work instead of git branch -a.
Assignee | ||
Comment 6•9 years ago
|
||
Bug 1203686 - Add git support to mach try's ability to find files changes on the current branch. r=jgraham
Attachment #8668573 -
Flags: review?(james)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → cmanchester
Comment 7•9 years ago
|
||
Comment on attachment 8668573 [details]
MozReview Request: Bug 1203686 - Add git support to mach try's ability to find files changes on the current branch. r=jgraham
https://reviewboard.mozilla.org/r/20983/#review18869
::: testing/tools/autotry/autotry.py:339
(Diff revision 1)
> + args = ['git', 'diff', '--name-only', 'HEAD', base_commit]
Probably better to do this with -z and split on null.
::: testing/tools/autotry/autotry.py:418
(Diff revision 1)
> hg_args = [
For consistency I would mildly prefer if we had both git and hg implementations in their own method and this method.
::: testing/tools/autotry/autotry.py:427
(Diff revision 1)
> return subprocess.check_output(hg_args).splitlines()
Shouldn't this have some friendly error message if it fails?
Attachment #8668573 -
Flags: review?(james)
Assignee | ||
Comment 8•9 years ago
|
||
https://reviewboard.mozilla.org/r/20983/#review18869
> Shouldn't this have some friendly error message if it fails?
If a single invocation of hg log fails, I would think the cause would be obvious, but sure.
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8668573 [details]
MozReview Request: Bug 1203686 - Add git support to mach try's ability to find files changes on the current branch. r=jgraham
Bug 1203686 - Add git support to mach try's ability to find files changes on the current branch. r=jgraham
Attachment #8668573 -
Flags: review?(james)
Updated•9 years ago
|
Attachment #8668573 -
Flags: review?(james) → review+
Comment 10•9 years ago
|
||
Comment on attachment 8668573 [details]
MozReview Request: Bug 1203686 - Add git support to mach try's ability to find files changes on the current branch. r=jgraham
https://reviewboard.mozilla.org/r/20983/#review18887
Comment 11•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•