Re: reverting vs resetting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avery Pennarun <apenwarr@xxxxxxxxx> writes:

> On Fri, Feb 5, 2010 at 1:12 AM, Mihamina Rakotomandimby
> <mihamina@xxxxxxxxxx> wrote:
>> When we decided to giveup, we decided to get back to the configuration
>> before Bob broke it. But it would be interesting to see Andy's history.
>>
>> Reverting or resetting?
>
> Try this:
>
>     git checkout HEAD~5 .
>     git commit -m "reverted back to the version before this mess"

Caveat: if Andy added new paths while experimenting, the above won't
remove it.  You would need something like this instead:

	git read-tree -m -u HEAD~50
        git commit -m "reverted back to the version before this mess"

But this all assumes that the futile experiment is worth keeping.  I
highly doubt it.

I would recommend to do this:

	git branch andy_failed_experiment
        git reset --hard HEAD~50
	;# and perhaps revert Bob's change here as well

There is no sane reason to keep the failed experiment that added nothing
of value to the history leading to the tip of the 'master' branch.

I am using the word _value_ but keep in mind that value is relative to the
purpose you have in mind.  The purpose of the 'master' branch presumably
is to keep and to improve on a working configuration of the gateway box.
For that particular purpose, you have to admit that Andy's futzing around
didn't add anything of value in the result.  Hence, that shouldn't be kept
in its history.

Andy and other people may be able to learn from the failed experiment
later, so it is perfectly Ok to keep the series of random hacks in a
separate branch to study at their leisure.  The purpose of the branch is
different from that of the 'master': it is to serve as a catalog of
things/ideas that did _not_ work.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]