threads / discuss / 50655

How to determine the order of commit

Subject: How to determine the order of commit

## tl;dr

4 messages between Mar 5, 2019 and Mar 5, 2019.

replies: 3people: 3as markdown or json

wuzhouhui· Mar 5, 2019, 08:51 UTC · lore
Hi,

Suppose I have "git format-patch" two commit from a repository like following:

  git format-patch -1 cf1c9ccba730
  git format-patch -1 d1a2930d8a99
Now, how to determine the commit order of these two patch in repository?
Christian Couder· Mar 5, 2019, 12:39 UTC · re: wuzhouhui · lore

Re: How to determine the order of commit

Hi,
On Tue, Mar 5, 2019 at 10:00 AM wuzhouhui <wuzhouhui14@mails.ucas.ac.cn> wrote:
Show 8 quoted lines
>
> Suppose I have "git format-patch" two commit from a repository like
> following:
>
>   git format-patch -1 cf1c9ccba730
>   git format-patch -1 d1a2930d8a99
>
> Now, how to determine the commit order of these two patch in repository?
Do you mean something like:
$ git merge-base --is-ancestor cf1c9ccba730 d1a2930d8a99
and:
$ git merge-base --is-ancestor d1a2930d8a99 cf1c9ccba730
?
wuzhouhui· Mar 5, 2019, 13:17 UTC · re: Christian Couder · lore

Re: How to determine the order of commit

Show 22 quoted lines
> On Mar 5, 2019, at 8:39 PM, Christian Couder <christian.couder@gmail.com> wrote:
> 
> Hi,
> 
> On Tue, Mar 5, 2019 at 10:00 AM wuzhouhui <wuzhouhui14@mails.ucas.ac.cn> wrote:
>> 
>> Suppose I have "git format-patch" two commit from a repository like
>> following:
>> 
>>  git format-patch -1 cf1c9ccba730
>>  git format-patch -1 d1a2930d8a99
>> 
>> Now, how to determine the commit order of these two patch in repository?
> 
> Do you mean something like:
> 
> $ git merge-base --is-ancestor cf1c9ccba730 d1a2930d8a99
> 
> and:
> 
> $ git merge-base --is-ancestor d1a2930d8a99 cf1c9ccba730
> 
Yep, that's what I want. Thanks!
> ?
Junio C Hamano· Mar 5, 2019, 13:59 UTC · re: Christian Couder · lore

Re: How to determine the order of commit

Christian Couder <christian.couder@gmail.com> writes:
Show 21 quoted lines
> Hi,
>
> On Tue, Mar 5, 2019 at 10:00 AM wuzhouhui <wuzhouhui14@mails.ucas.ac.cn> wrote:
>>
>> Suppose I have "git format-patch" two commit from a repository like
>> following:
>>
>>   git format-patch -1 cf1c9ccba730
>>   git format-patch -1 d1a2930d8a99
>>
>> Now, how to determine the commit order of these two patch in repository?
>
> Do you mean something like:
>
> $ git merge-base --is-ancestor cf1c9ccba730 d1a2930d8a99
>
> and:
>
> $ git merge-base --is-ancestor d1a2930d8a99 cf1c9ccba730
>
> ?
What if neither is true ;-)?

← back to recent threads