git diff using change IDs

670 views
Skip to first unread message

ms

unread,
Apr 18, 2015, 9:43:56 AM4/18/15
to repo-d...@googlegroups.com

I need to find the difference between two branches by gerrit Change IDs, not by files or commit IDs. I mean, the commits which are not in one branch.

Is there any way to get the diff by gerrit change IDs??

Alex Blewitt

unread,
Apr 18, 2015, 9:54:42 AM4/18/15
to ms, repo-d...@googlegroups.com
You can fetch the changes which is shown on the change screen and then use standard diff tools to process them. The refs look like refs/change/12/1234 iirc. 

Sent from my iPad

On 18 Apr 2015, at 14:43, ms <mrutyunj...@gmail.com> wrote:

I need to find the difference between two branches by gerrit Change IDs, not by files or commit IDs. I mean, the commits which are not in one branch.

Is there any way to get the diff by gerrit change IDs??

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ms

unread,
Apr 19, 2015, 2:49:51 AM4/19/15
to repo-d...@googlegroups.com, mrutyunj...@gmail.com
Will it work for "Change ID" ?? don't want to use  commit/SHA1 IDs. and want to calculate the diff between two branches. 

Magnus Bäck

unread,
Apr 20, 2015, 2:31:18 AM4/20/15
to ms, repo-d...@googlegroups.com
On Sunday, April 19, 2015 at 08:49 CEST,
ms <mrutyunj...@gmail.com> wrote:

> Will it work for "Change ID" ?? don't want to use commit/SHA1 IDs.
> and want to calculate the diff between two branches.

Git doesn't know anything about change IDs. It only knows about refs
and SHA-1s. You can easily look up change IDs and get refs and SHA-1s.
This indirection shouldn't be a problem.

By the way, your original question,

> I need to find the difference between two branches by gerrit Change
> IDs, not by files or commit IDs. I mean, the commits which are not
> in one branch.

doesn't quite make sense. Change IDs don't identify branches, they
identify commits. So it's actually commits you want to compare?

--
Magnus Bäck | Software Engineer, Development Tools
magnu...@sonymobile.com | Sony Mobile Communications

Sven Selberg

unread,
Apr 21, 2015, 8:55:30 AM4/21/15
to repo-d...@googlegroups.com, mrutyunj...@gmail.com


Den måndag 20 april 2015 kl. 08:31:18 UTC+2 skrev Magnus Bäck:
On Sunday, April 19, 2015 at 08:49 CEST,
     ms <mrutyunj...@gmail.com> wrote:

> Will it work for "Change ID" ?? don't want to use  commit/SHA1 IDs.
> and want to calculate the diff between two branches.

Git doesn't know anything about change IDs. It only knows about refs
and SHA-1s. You can easily look up change IDs and get refs and SHA-1s.
This indirection shouldn't be a problem.

By the way, your original question,

> I need to find the difference between two branches by gerrit Change
> IDs, not by files or commit IDs. I mean, the commits which are not
> in one branch.

doesn't quite make sense. Change IDs don't identify branches, they
identify commits. So it's actually commits you want to compare?

 
Even  worse:
Change IDs don't even identity commit's it identifies Changes, so you could have several commits with the same Change ID.

/Sven
Reply all
Reply to author
Forward
0 new messages