Perhaps I had not mentioned it or emphasize it - it is considered
VERY BAD PRACTISE to rebase and rewrite commits which are
already made public. What is public is public, and should not ever be changed.
You should only ever rewrite/rebase commits
which have not been pushed. The reason is that others might
already started basing their work on your already-public work
and you rewriting history for already-public work will seriously
disrupt others. Do not do that. Just don't.
You must recover your old work within 2 weeks - that's the time window
where rebase (or other loss in git) can be recovered. Work older than that
could be purged by git
during routine maintainence.
You can, and you should recover your pre-rebase work, by looking at
"git reflog".
NOTE: Since data recovery is potentially a dangerous operation,
and your work is small enough, you should actually preserve the current state of
the entire git repository first by tar'ing the whole thing up. e.g.
cd ..
tar -cjpvf somewhere-else/my-repo-backup.tar.bz2 spdx-tools-python
Then, dump the reflog to a file - i.e.
git reflog > somewhere-else/my-git-reflog
Look for consecutive entries like:
ea4547f HEAD@{187}: rebase: checkout origin
144abfe HEAD@{188}: commit: ...
"ea4547f" is what you passed to "git rebase -i" . "144abfe" is the top of your
head before
rebase. You can recover the old head by doing
git checkout -b recovered_head_144abfe 144abfe
Since you may have rebased a few times, you should do a recovery for
each of the rewrites. You can then rename some of these recovered branches to
something
more sensible before publish them out again. (e.g. recovered_head_on_date, etc).
The last non-rewritten commit I have is this:
commit dc1796075ba452c8e92df5fa252aaaaf91bd0f9b
Author: Ahmed H. Ismail <[email protected]>
Date: Mon Aug 4 01:09:08 2014 +0300
At this point, I also suggest that you upload a copy of the
"my-repo-backup.tar.bz2"
for me to look at to check that your data recovery is correct.
--------------------------------------------
On Sat, 16/8/14, ahi <[email protected]> wrote:
<snipped>
I think (4) is the worst crime in general - when a commit
description does not match
what the code diff actually does.
I have fixed
some of the earlier history using rebase and pushed the
updates, I am still working on the rest.
--
Best Regards,
Ahmed
_______________________________________________
Spdx-tech mailing list
[email protected]
https://lists.spdx.org/mailman/listinfo/spdx-tech