[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
accidental reverts in git
From: |
Mark Polesky |
Subject: |
accidental reverts in git |
Date: |
Fri, 11 Jul 2014 09:24:00 -0700 |
In response to http://code.google.com/p/lilypond/issues/detail?id=3952#c7
David, here's a simplified version of the faulty workflow.
The problem occurs in step 5 where I accidentally did
`HEAD..bar' instead of `master..bar' (thinko). In step 7
the "accidental reversion" of the "foo" branch happens,
which can be easy to miss in a visual check, especially if
there are a lot of files modified by the "bar" branch, as
was the case with my LilyPond commit #0ea80a5e.
I'm definitely not a git guru, and there's probably a better
way, so feel free to suggest one. In the meantime I'll try
to be more vigilant about this. I don't want it to happen
again either!
Thanks,
Mark
1) git log --graph --all --decorate --oneline | cat
* a9af02f (bar) Finish fixing bar.
* d3b60de Start fixing bar.
| * 38e720f (foo) Fix foo.
|/
* 9491de4 (HEAD, staging, master) HEAD of master branch.
2) git co staging
3) git cherry-pick foo
4) git log --graph --all --decorate --oneline | cat
* c7b770d (HEAD, staging) Fix foo.
| * a9af02f (bar) Finish fixing bar.
| * d3b60de Start fixing bar.
|/
| * 38e720f (foo) Fix foo.
|/
* 9491de4 (master) HEAD of master branch.
5) git diff HEAD..bar > patch0.patch
6) git apply patch0.patch
7) git commit -am"Fix bar."
8) git log --graph --all --decorate --oneline | cat
* 8d7e0e3 (HEAD, staging) Fix bar.
* c7b770d Fix foo.
| * a9af02f (bar) Finish fixing bar.
| * d3b60de Start fixing bar.
|/
| * 38e720f (foo) Fix foo.
|/
* 9491de4 (master) HEAD of master branch.
- accidental reverts in git,
Mark Polesky <=