git howto get a single diff for a PR with multiple commits

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

git howto get a single diff for a PR with multiple commits

Markus Metz-3
Hi git gurus,

I would like to speed up reviewing of a PR with multiple commits by reading a single diff file. How is this possible with git? An example is https://github.com/OSGeo/grass/pull/28

Is this only possible in github looking at the "Files changed"? If github can do this, can git (on CLI on my local copies) also do this?

Thanks,

Markus M

_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: git howto get a single diff for a PR with multiple commits

Ken Mankoff

On 2019-06-04 at 23:12 +02, Markus Metz <[hidden email]> wrote...
> I would like to speed up reviewing of a PR with multiple commits by
> reading a single diff file. How is this possible with git? [...] can
> git (on CLI on my local copies) also do this?

I think git can diff any two commits. Do this by providing two commit hashes instead of just one (which defaults to that v. the currently checked out hash + any local changes).

  -k.
_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: git howto get a single diff for a PR with multiple commits

Peter Petrik
Hi,

you can diff the branch agains the branch origin point (see eg https://stackoverflow.com/questions/29810331/is-there-a-quick-way-to-git-diff-from-the-point-or-branch-origin). For example if you PR 28 is on local branch pr_28, branched from master you can do:

git checkout pr_28
git diff master...

P.



On Wed, Jun 5, 2019 at 6:44 AM Ken Mankoff <[hidden email]> wrote:

On 2019-06-04 at 23:12 +02, Markus Metz <[hidden email]> wrote...
> I would like to speed up reviewing of a PR with multiple commits by
> reading a single diff file. How is this possible with git? [...] can
> git (on CLI on my local copies) also do this?

I think git can diff any two commits. Do this by providing two commit hashes instead of just one (which defaults to that v. the currently checked out hash + any local changes).

  -k.
_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev

_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: git howto get a single diff for a PR with multiple commits

Markus Metz-3


On Wed, Jun 5, 2019 at 7:51 AM Peter Petrik <[hidden email]> wrote:
>
> Hi,
>
> you can diff the branch agains the branch origin point (see eg https://stackoverflow.com/questions/29810331/is-there-a-quick-way-to-git-diff-from-the-point-or-branch-origin). For example if you PR 28 is on local branch pr_28, branched from master you can do:
>
> git checkout pr_28
> git diff master...

that's exactly what I was looking for, thanks!

Markus M
>
> P.

>
>
>
> On Wed, Jun 5, 2019 at 6:44 AM Ken Mankoff <[hidden email]> wrote:
>>
>>
>> On 2019-06-04 at 23:12 +02, Markus Metz <[hidden email]> wrote...
>> > I would like to speed up reviewing of a PR with multiple commits by
>> > reading a single diff file. How is this possible with git? [...] can
>> > git (on CLI on my local copies) also do this?
>>
>> I think git can diff any two commits. Do this by providing two commit hashes instead of just one (which defaults to that v. the currently checked out hash + any local changes).
>>
>>   -k.
>> _______________________________________________
>> grass-dev mailing list
>> [hidden email]
>> https://lists.osgeo.org/mailman/listinfo/grass-dev
_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: git howto get a single diff for a PR with multiple commits

Markus Neteler
Hi,

On Wed, Jun 5, 2019 at 2:28 PM Markus Metz
<[hidden email]> wrote:
> On Wed, Jun 5, 2019 at 7:51 AM Peter Petrik <[hidden email]> wrote:
> > Hi,
> >
> > you can diff the branch agains the branch origin point (see eg https://stackoverflow.com/questions/29810331/is-there-a-quick-way-to-git-diff-from-the-point-or-branch-origin). For example if you PR 28 is on local branch pr_28, branched from master you can do:
> >
> > git checkout pr_28
> > git diff master...
>
> that's exactly what I was looking for, thanks!

Thanks, I have taken liberty to add the trick to

https://trac.osgeo.org/grass/wiki/HowToGit#Codereview:generateasinglediffforaPRwithmultiplecommits

markusN
_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev