recover commits on mob

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

recover commits on mob

Ramsay Jones-2
Hi Herman, Danny,

I just pushed a fix-up to the 'mob' branch to recover three
commits which had been 'overwritten' somehow. (Danny, did
you not see an error message when you tried to push?).

ATB,
Ramsay Jones

_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: recover commits on mob

Danny Milosavljevic
Hi,

On Tue, 5 Jan 2021 18:12:35 +0000
Ramsay Jones <[hidden email]> wrote:

> I just pushed a fix-up to the 'mob' branch to recover three
> commits which had been 'overwritten' somehow. (Danny, did
> you not see an error message when you tried to push?).

Thank you!

I've reconstructed what could have happened.

In the current tinycc-suggested workflow

  git push ssh://[hidden email]/srv/git/tinycc.git arm-asm:mob

it turns out that the colon separates the local branch from the upstream branch,
so, here, it pushes my branch "arm-asm" as the upstream branch "mob" (WTF!).
That sounds dangerous.  Also, it is not what I thought that does.

So I think what happened is that one time I force-pushed and overwrote the mob
branch with a command like the one above (sorry).  It should have only affected
a tiny bit though since I rebase arm-asm on top of mob.

In the future, I'll switch over to using this instead (while working
in the local "arm-asm" branch):

git checkout mob
git pull --rebase

git checkout arm-asm
git rebase mob

git checkout mob
git merge arm-asm
git push -u origin mob # the first time; later times just "git push".

That would make merges explicit and would thus be much safer.  Also, it's
how I use git elsewhere.

(I had never seen the foo:bar with URL push syntax before)

_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: recover commits on mob

tinycc-devel mailing list
I reapplied the last 2 patches again.

     Herman

On 1/5/21 7:35 PM, Danny Milosavljevic wrote:

> Hi,
>
> On Tue, 5 Jan 2021 18:12:35 +0000
> Ramsay Jones <[hidden email]> wrote:
>
>> I just pushed a fix-up to the 'mob' branch to recover three
>> commits which had been 'overwritten' somehow. (Danny, did
>> you not see an error message when you tried to push?).
> Thank you!
>
> I've reconstructed what could have happened.
>
> In the current tinycc-suggested workflow
>
>    git push ssh://[hidden email]/srv/git/tinycc.git arm-asm:mob
>
> it turns out that the colon separates the local branch from the upstream branch,
> so, here, it pushes my branch "arm-asm" as the upstream branch "mob" (WTF!).
> That sounds dangerous.  Also, it is not what I thought that does.
>
> So I think what happened is that one time I force-pushed and overwrote the mob
> branch with a command like the one above (sorry).  It should have only affected
> a tiny bit though since I rebase arm-asm on top of mob.
>
> In the future, I'll switch over to using this instead (while working
> in the local "arm-asm" branch):
>
> git checkout mob
> git pull --rebase
>
> git checkout arm-asm
> git rebase mob
>
> git checkout mob
> git merge arm-asm
> git push -u origin mob # the first time; later times just "git push".
>
> That would make merges explicit and would thus be much safer.  Also, it's
> how I use git elsewhere.
>
> (I had never seen the foo:bar with URL push syntax before)


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: recover commits on mob

Ramsay Jones-2


On 05/01/2021 18:48, Herman ten Brugge wrote:
> I reapplied the last 2 patches again.

Oops, sorry did I mess-up? (I had the repo.or.cz website open
and, just before pushing, checked that no new commits had come
in - I also git a 'git fetch origin' just seconds before the
push!).

Sorry for the inconvenience!

ATB,
Ramsay Jones


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: recover commits on mob

tinycc-devel mailing list
Oops. I should have said:

I reapplied the last 2 missing patches again.

Everything is fine now.

Thanks for the help.

    Herman

On 1/5/21 8:00 PM, Ramsay Jones wrote:

On 05/01/2021 18:48, Herman ten Brugge wrote:
I reapplied the last 2 patches again.
Oops, sorry did I mess-up? (I had the repo.or.cz website open
and, just before pushing, checked that no new commits had come
in - I also git a 'git fetch origin' just seconds before the
push!).

Sorry for the inconvenience!

ATB,
Ramsay Jones



_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: recover commits on mob

grischka
In reply to this post by Danny Milosavljevic
Danny Milosavljevic wrote:
> So I think what happened is that one time I force-pushed and overwrote the mob
> branch with a command like the one above (sorry).  It should have only affected
> a tiny bit though since I rebase arm-asm on top of mob.

Do not use the -f option with push,  please.

> In the future, I'll switch over to using this instead (while working
> in the local "arm-asm" branch):
> ...
> git merge arm-asm

No, do not push merge commits please.  If you look at it there are
(almost) no merge commits in the tinycc git history, and that is
intentional.

Just push your commits on top of the public mob branch.  You can
use any notation or procedure you prefer, as long as the result
is fast-forward of the remote branch and no merge commits.

Thanks,

-- gr

> git push -u origin mob # the first time; later times just "git push".
>
> That would make merges explicit and would thus be much safer.  Also, it's
> how I use git elsewhere.
>
> (I had never seen the foo:bar with URL push syntax before)

_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: recover commits on mob

Michael Matz
In reply to this post by Danny Milosavljevic
Hello,

On Tue, 5 Jan 2021, Danny Milosavljevic wrote:

> On Tue, 5 Jan 2021 18:12:35 +0000
> Ramsay Jones <[hidden email]> wrote:
>
>> I just pushed a fix-up to the 'mob' branch to recover three
>> commits which had been 'overwritten' somehow. (Danny, did
>> you not see an error message when you tried to push?).
>
> Thank you!
>
> I've reconstructed what could have happened.
>
> In the current tinycc-suggested workflow
>
>  git push ssh://[hidden email]/srv/git/tinycc.git arm-asm:mob

Yeah, but you must have used -f somewhere.  Almost never a good idea when
pushing to some remote :-)


Ciao,
Michael.

_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel