public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
* Apologies for wrong commit error
@ 2011-03-19 21:35 Pierre Muller
  2011-03-19 21:46 ` Jan Kratochvil
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2011-03-19 21:35 UTC (permalink / raw)
  To: archer

While trying to use git,

I made a mistake by changing the merge
field of my branch in my local configuration file.

  On the next
git push
I used, my branch was suddenly pushed to origin/master
instead of my branch on remote server,
despite having a 
push line in my config file...

  I hope that I was able to undo my
wrong commit by this second one:

Those
commit c40415cfe4d602ded27d296c771006609596d5f4
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Sat Mar 19 22:27:17 2011 +0100

     * Undo last wrong patch

commit e65e6659973dc8554f75f731491986720d7f3929
Merge: 03c052c cdf4dfa
Author: Pierre Muller <muller@ics.u-strasbg.fr>


Date:   Sat Mar 19 22:00:51 2011 +0100

    Merge branch 'master' of ssh://sourceware.org/git/archer into
archer-muller-


 Could someone with enough git knowledge 
check that the second did exactly cancel the first wrong commit?

  Can an admin completely wipe my error out?

  Sorry for all the troubles I am generating...

Pierre Muller
GDB pascal language maintainer


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Apologies for wrong commit error
  2011-03-19 21:35 Apologies for wrong commit error Pierre Muller
@ 2011-03-19 21:46 ` Jan Kratochvil
  2011-03-19 23:31   ` [Archer] " Joel Brobecker
  2011-03-19 23:40   ` Pierre Muller
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Kratochvil @ 2011-03-19 21:46 UTC (permalink / raw)
  To: Pierre Muller; +Cc: archer

Hi Pierre,

On Sat, 19 Mar 2011 22:34:58 +0100, Pierre Muller wrote:
>  Could someone with enough git knowledge 
> check that the second did exactly cancel the first wrong commit?

It seems OK now to me.
git diff cdf4dfaa567c4903b2fce0a16a2e5702e059932e..c40415cfe4d602ded27d296c771006609596d5f4
shows no change.


>   Can an admin completely wipe my error out?

AFAIK it should not affect operations with master.  It is now more a problem
for the archer-muller-windows-multi branch as AFAIK there is no way to do a
real undo of a GIT merge.  GIT will now still think the current version of
archer-muller-windows-multi is already present in master, therefore this
command now no longer shows what has changed on archer-muller-windows-multi
(even if master has more recent updates):
	git diff origin/master...origin/archer-muller-windows-multi


Regards,
Jan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Archer] Re: Apologies for wrong commit error
  2011-03-19 21:46 ` Jan Kratochvil
@ 2011-03-19 23:31   ` Joel Brobecker
  2011-03-19 23:47     ` Pierre Muller
  2011-03-19 23:40   ` Pierre Muller
  1 sibling, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2011-03-19 23:31 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Pierre Muller, archer

> AFAIK it should not affect operations with master.  It is now more a problem
> for the archer-muller-windows-multi branch as AFAIK there is no way to do a
> real undo of a GIT merge.  GIT will now still think the current version of
> archer-muller-windows-multi is already present in master, therefore this
> command now no longer shows what has changed on archer-muller-windows-multi
> (even if master has more recent updates):
> 	git diff origin/master...origin/archer-muller-windows-multi

You could undo the change by forcing the HEAD (reference) back to
the commit prior to the accidental one. I've never actually done
this before, but something like this, perhaps:

        % git reset --hard <SHA1>
        % git push origin master

This should restore the history to what it was prior to accidental
commit.

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Apologies for wrong commit error
  2011-03-19 21:46 ` Jan Kratochvil
  2011-03-19 23:31   ` [Archer] " Joel Brobecker
@ 2011-03-19 23:40   ` Pierre Muller
  1 sibling, 0 replies; 7+ messages in thread
From: Pierre Muller @ 2011-03-19 23:40 UTC (permalink / raw)
  To: 'Jan Kratochvil', 'Joel Brobecker'; +Cc: archer



> -----Message d'origine-----
> De : archer@sourceware.org [mailto:archer@sourceware.org] De la part de
> Jan Kratochvil
> Envoyé : samedi 19 mars 2011 22:46
> À : Pierre Muller
> Cc : archer@sourceware.org
> Objet : Re: Apologies for wrong commit error
> 
> Hi Pierre,
> 
> On Sat, 19 Mar 2011 22:34:58 +0100, Pierre Muller wrote:
> >  Could someone with enough git knowledge
> > check that the second did exactly cancel the first wrong commit?
> 
> It seems OK now to me.
> git diff
> cdf4dfaa567c4903b2fce0a16a2e5702e059932e..c40415cfe4d602ded27d296c77100
> 6609596d5f4
> shows no change.

  Thank you for the check,
I got strange results when I tried to do the same...
 
> >   Can an admin completely wipe my error out?
> 
> AFAIK it should not affect operations with master.  It is now more a
> problem
> for the archer-muller-windows-multi branch as AFAIK there is no way to
> do a
> real undo of a GIT merge.  GIT will now still think the current version
> of
> archer-muller-windows-multi is already present in master, therefore
> this
> command now no longer shows what has changed on archer-muller-windows-
> multi
> (even if master has more recent updates):
> 	git diff origin/master...origin/archer-muller-windows-multi

  This should be fixed now,
after I committed my last local version back to the git remote server.
At least, 
git diff origin/master...origin/archer-muller-windows-multi
seems to give back the local changes...

> From Joel:
>You could undo the change by forcing the HEAD (reference) back to
>the commit prior to the accidental one. I've never actually done
>this before, but something like this, perhaps:
>
>        % git reset --hard <SHA1>
>        % git push origin master
>
>This should restore the history to what it was prior to accidental
>commit.

  But this is what I was already unable to do on my own branch:
I got this warning about wiping out history 
and a suggestion about using 
  git push --force
but when I tried it out with --force option,
it did not work. It  seems to be a git remote configuration
option to disable the possibility of such pushes.


  Thanks to both of you,

Pierre
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [Archer] Re: Apologies for wrong commit error
  2011-03-19 23:31   ` [Archer] " Joel Brobecker
@ 2011-03-19 23:47     ` Pierre Muller
  2011-03-20  4:48       ` [Archer] " Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2011-03-19 23:47 UTC (permalink / raw)
  To: 'Joel Brobecker', 'Jan Kratochvil'; +Cc: archer

> You could undo the change by forcing the HEAD (reference) back to
> the commit prior to the accidental one. I've never actually done
> this before, but something like this, perhaps:
> 
>         % git reset --hard <SHA1>
>         % git push origin master
> 
> This should restore the history to what it was prior to accidental
> commit.

 As expected in my previous email, this is not possible:

Pierre@E6510-Muller ~/git/archer
$ git push  --force origin master
Total 0 (delta 0), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull
first
)
To ssh://sourceware.org/git/archer.git
 ! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://sourceware.org/git/archer.git'

 
  Thus my error is written in stone forever :(



Pierre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Archer] RE: [Archer] Re: Apologies for wrong commit error
  2011-03-19 23:47     ` Pierre Muller
@ 2011-03-20  4:48       ` Joel Brobecker
  2011-03-20 12:40         ` Pierre Muller
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2011-03-20  4:48 UTC (permalink / raw)
  To: Pierre Muller; +Cc: 'Jan Kratochvil', archer

>  As expected in my previous email, this is not possible:
> 
> Pierre@E6510-Muller ~/git/archer
> $ git push  --force origin master
> Total 0 (delta 0), reused 0 (delta 0)
> remote: error: denying non-fast-forward refs/heads/master (you should pull
> first
> )
> To ssh://sourceware.org/git/archer.git
>  ! [remote rejected] master -> master (non-fast-forward)
> error: failed to push some refs to 'ssh://sourceware.org/git/archer.git'

Ah, my bad.  I had hoped that --force would have allowed us force
the push.

>   Thus my error is written in stone forever :(

Just like it would have been with any other version control system.
We all do our best, and in the end, if the error is corrected,
I don't think it's an issue all.

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [Archer] RE: [Archer] Re: Apologies for wrong commit error
  2011-03-20  4:48       ` [Archer] " Joel Brobecker
@ 2011-03-20 12:40         ` Pierre Muller
  0 siblings, 0 replies; 7+ messages in thread
From: Pierre Muller @ 2011-03-20 12:40 UTC (permalink / raw)
  To: 'Joel Brobecker'; +Cc: 'Jan Kratochvil', archer



> -----Message d'origine-----
> De : Joel Brobecker [mailto:brobecker@adacore.com]
> Envoyé : dimanche 20 mars 2011 05:48
> À : Pierre Muller
> Cc : 'Jan Kratochvil'; archer@sourceware.org
> Objet : Re: [Archer] RE: [Archer] Re: Apologies for wrong commit error
> 
> >  As expected in my previous email, this is not possible:
> >
> > Pierre@E6510-Muller ~/git/archer
> > $ git push  --force origin master
> > Total 0 (delta 0), reused 0 (delta 0)
> > remote: error: denying non-fast-forward refs/heads/master (you should
> pull
> > first
> > )
> > To ssh://sourceware.org/git/archer.git
> >  ! [remote rejected] master -> master (non-fast-forward)
> > error: failed to push some refs to
> 'ssh://sourceware.org/git/archer.git'
> 
> Ah, my bad.  I had hoped that --force would have allowed us force
> the push.
> 
> >   Thus my error is written in stone forever :(
> 
> Just like it would have been with any other version control system.
> We all do our best, and in the end, if the error is corrected,
> I don't think it's an issue all.

  The worst part is that I almost didn't notice that the patch went to the
wrong 
branch on repository.
  I tried hard to find a way to have a local branch with a short name
like wmulti instead of archer-muller-windows-multi because
I am lazy as most people are.

  I could find no way to tell to git program
that a simple
git push 
should push everything to origin/archer-muller-windows-multi

  A while later, I just did this change in config, from 
[branch "archer-muller-windows-multi"]
        remote = origin
        merge = refs/heads/archer-muller-windows-multi
        push = refs/heads/archer-muller-windows-multi

to 
[branch "archer-muller-windows-multi"]
        remote = origin
        merge = refs/heads/master
        push = refs/heads/archer-muller-windows-multi
(OK, this is a mistake, but I really didn't expect 
such a consequence...)
and used a simple
make push
to discover that commit was sent to origin/master instead of
origin/archer-muller-windows-multi

  Which makes me wonder why it did not work when I tried
[branch "wmulti"]
        remote = origin
        merge = refs/heads/archer-muller-windows-multi
Here
make push 
never updated origin/archer-muller-windows-multi

  Kind of illogical, no?

Pierre
  

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-20 12:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-19 21:35 Apologies for wrong commit error Pierre Muller
2011-03-19 21:46 ` Jan Kratochvil
2011-03-19 23:31   ` [Archer] " Joel Brobecker
2011-03-19 23:47     ` Pierre Muller
2011-03-20  4:48       ` [Archer] " Joel Brobecker
2011-03-20 12:40         ` Pierre Muller
2011-03-19 23:40   ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).