0

I want to compare the differnt commits with two repos, for example Android_10.0_r2 and Android_11.0_r3

the changes are frequent and since Google merge inner code to AOSP, some commit even older than Android_10.0_r2 merged to Android_11.0_r3, I don't want to miss that from git log checking

so I record all commit logs in both repos and select the different change_ids/commit_ids.

But since the git log is too much in AOSP and it have 400+ repos, it runs 1 hour+ in my PC.

Any idea that git command may have directly way for geting the different commit_ids between two repo?

The git diff with two repo dir shows diff of the files, since changelist is long, the commit message diff is more effective

4
  • 2
    I don't know how AOSP repo is set up, and I don't fully understand your question. Are you comparing two different repositories ? Or are 10.0 and 11.0 two branches in the same repository ? Commented Dec 24, 2020 at 13:30
  • The AOSP repo have 400+ git repositories and controled by repo tools from google. The 10.0 and 11.0 are two group of branches with tags ,but this two branches are forked from different dev branch(dev branch are from master but differs much). Commented Dec 25, 2020 at 1:12
  • Do you mean "400+ commits" ? Commented Dec 25, 2020 at 1:43
  • I mean each branch 10.0 and 11.0 have more than 400+ git repos Commented Dec 25, 2020 at 2:02

1 Answer 1

1

Every version of AOSP has its own manifest. Use repo sync -n -m /path/to/manifest1.xml and repo sync -n -m /path/to/manifest2.xml to fetch repositories' data of both. -n instructs repo to fetch data only and not checkout/update the worktrees, which could be omitted if you want to see the real files.

And then use repo diffmanifests /path/to/manifest1.xml /path/to/manifest2.xml to display the diff commits between 2 code bases. It has an option --pretty-format=<FORMAT> which works like --pretty=<FORMAT> in git log.

However the output is still a bit rough. Another solution is making a script, in Python for example, to parse the 2 manifests and run git log or git diff to get the detailed information. It's much more flexible. To my experience, it won't take that long. Our code base has about 1500 repositories.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks, this diffmanifests works fine with multi reops :) , any idea if it could get a --no-merge output ? the repo flow seems using a git log rev1.. rev2 to get the raw data, which get the merge data in
@butter In the code base, open .repo/repo/project.py and find def _getLogs. Insert cmd.append('--no-merges') at the proper line. Save, exit and try repo diffmanifests again. I'm still using an old version of repo tool. You could also try repo diffmanifests --help to check if it has some option to ignore merge commits.
@EIpieKay, I tried repo diffmanifests modification it works fine,but from the output checking by hand , I coincidently found strange things: The outputs in repo diffmanifests manifest1.xml manifest2.xml (manifest1 is older tag and manifest2is newer) contains the commits in manifest1, which is supposed to only contain the commits in manifest2 not in manifest1. The git command in same repo with git log rev1..rev2 --no-merges also have seem issue. Do you got any idea that may cause it?
@butter Use git log --oneline --graph rev1..rev2 to check the relationship between the commits of the two heads. The command might work differently from how you expect.
@EIpieKay it looks like the merge/cherry-pick in AOSP multi-branch make dup commit with different id,and git treat different commit id as different commit,that's maybe the reason why git log rev1..rev2 may contain the commit existing in rev1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.