Re: emacs.git 'master' reset

<[email protected]> Sun, 26 Jul 2026 14:50:40 +0200
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
On Sun, Jul 26, 2026 at 03:17:23PM +0300, Eli Zaretskii wrote:
> > From: Sean Whitton <[email protected]>
> > Cc: [email protected]
> > Date: Sun, 26 Jul 2026 12:57:46 +0100
> > 
> > Eli Zaretskii [26/Jul  2:51pm +03] wrote:
> > > I did pull and push, but have no unpushed commits (AFAIK), so what
> > > should I do?
> > 
> >     git reset --hard origin/master
> > 
> > Sorry, should have mentioned this case.
> 
> But currently "git status" says "ahead 10", presumably because I have
> commits from before emacs.git on Savannah was reset.  Won't the
> above command lose all those commits?  Or were they already re-pushed?

It will, if they are in the branch in question (master).

You can either

(a) rename your current master to save your commits and compare later:

  git branch -m master my-old-master

(of course, master should be clean at this moment, and not the branch
currently checked out)

Comparison will be made a bit harder since the now "history manipulated"
master and yours diverge from the point the history was manipulated. But
that's recent, so...

You'd pull your commits from the created branch (my-old-master here)
via, e.g. git cherry-pick

(b) tar away your current repo (or just move it to another directory tree),
make a fresh clone and, in your old repo make patches for your new commits,
applying them to the new repo (basically, this is what you would do under
(a), but there you have git's support).

I still think changing history is a bad idea. There may be legitimate cases
(one I know of is having committed a secret (e.g. password) which is hard
to change quickly.

Cheers
-- 
t
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCamYCmQAKCRAFyCz1etHa
Rt2QAJ0ZpBjqP6VTmSFbi/gG6dUsniy9DwCfWsOOr3cTeWyDSdiqQQ9XK1l2Z+c=
=KeV8
-----END PGP SIGNATURE-----