Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 May 2021 22:08:50 +0200
From:      Kurt Jaeger <pi@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        git@freebsd.org
Subject:   Re: Ports tree have been migrated to git
Message-ID:  <YI21Uht4hkDHwvvF@fc.opsec.eu>
In-Reply-To: <CANCZdfpGx9SnSVPOBt0e5SOT0rzQbeOd%2BSZeMKTWkrXWZS3KMw@mail.gmail.com>
References:  <CAKBkRUzXAcXfFuD74VEPG0jAQBrmkQQdqAiBMR21vX3mA%2B4mkQ@mail.gmail.com> <YI2rkuT2W2bpPCpR@fc.opsec.eu> <CANCZdfpGx9SnSVPOBt0e5SOT0rzQbeOd%2BSZeMKTWkrXWZS3KMw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi!

> > Right now, for reasons that are unclear to me, I still have some
> > local commit hanging around in that tree that I can't get removed.
[...]
> > Can someone please help me understand how to just get rid of
> > some commit not yet pushed ?

> git reset --hard HEAD^
> 
> removes the last commit from the branch you have checked out.

Ok, I applied this once and had the revert of my local commit
removed.

I then applied it a second time, and now a

git show

displays me the
commit 9df78543e018a28c73fc97caff2c3ac9cc7b62f7
(the transcode revert from se@)

as the last uncommitted (?) change in my poudriere ports tree.
I expected 'git show' to return nothing, so that I know that
my tree is in sync with the remote tree.

> You can put
> any rev in place of HEAD^ if you know that is where you want to roll back
> to.

I just want to be back in the state where git show does not show
any changes 8-}

> You might use "freebsd/main" to reset to upstream (assuming you use the
> freebsd origin convention).

I think I follow that convention, but:

git reset --hard freebsd/main
fatal: ambiguous argument 'freebsd/main': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

> Also, git reflog will remember, for a while, all the branch moves and you
> can use that to recover those local commits.

So reflog showed:

[...]

01fbe73ae HEAD@{14}: reset: moving to HEAD
01fbe73ae HEAD@{15}: revert: Revert "net/dante: update 1.4.2 -> 1.4.3"
1f182d137 HEAD@{16}: reset: moving to HEAD
1f182d137 HEAD@{17}: reset: moving to HEAD

and I tried to get to the state @ 1f182d137:

which still is not the state I want to be in, because now git
shows me

1f182d137defe95f4b4b46a3003f203957021a9d

again. I'm really lost here 8-( Looks more and more like

https://xkcd.com/1597/

-- 
pi@FreeBSD.org         +49 171 3101372                  Now what ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YI21Uht4hkDHwvvF>