git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] contrib git-resurrect: find traces of a branch name and resurrect it

From
Boyd Stephen Smith Jr. <bss@iguanasuicide.net>
Date
Jan 23, 2009, 21:00 UTC
Message-ID
<200901231500.23182.bss@iguanasuicide.net>
In-Reply-To
<1232740985-4551-1-git-send-email-trast@student.ethz.ch>
On Friday 2009 January 23 14:03:05 Thomas Rast wrote:
Show 9 quoted lines
>Boyd Stephen Smith Jr. wrote:
>> I think it could be quite nice; "undelete"-type commands are generally
>> well-received by users and when run against reflogs alone, that's what the
>> command is.
>>
>> It's useful enough to me that I'd love to see it mainlined.
>
>So here's a version for contrib with more options and some other
>tweaks.
I wanted/needed the ability to ignore reflogs entirely.  Use went something 
like this:
1. resurrect branch from origin/pu
2. add patches, mail to list
3. # wait 24 hours
4. pull, see from logs that branch was modified, but not just my changes (or 
without all of my changes).
5. delete local branch
6. Try to resurrect branch from origin/pu, get local version I just deleted.
7. delete reflog for that branch
8. Try to resurrect branch from origin/pu, get local version I merged into 
master at some point.
9. Add new option.

So, I added a couple of options locally: --only-merges, so it would only look at the first line of commit logs, ignoring my local reflogs entirely; and --revisions, to specify arguments to pass to rev-list so it wouldn't even see my local merges (I passed 'origin/pu origin/next').

Yeah, my usage might be abusage, but it worked for me. :)

Would you object to a patch adding a --reflog option and allowing each of the scan options to be negated?

>I removed the ability to "batch resurrect" with several <name>
>arguments since that would have conflicted with -b <newname>, but
>otherwise the features are the same.

In my local version, which I was going to try and clean up over the weekend, I was going to support both, by borrowing refspec syntax from fetch/push. Specifically. Resurrecting 'js/notes' as 'pu/js/notes' would look like: git-resurrect -H js/notes:pu/js/notes

Would you object to a patch that dropped -b in favor of the refspec syntax?
Show 8 quoted lines
>> In my particular case, it wasn't useful without the -m option, but I
>> understand why it is not the default.
>
>Aside from the obvious speed reasons, I don't really want to teach
>people that commits "know" the branch they were on.  It is a pure
>coincidence if you can resurrect a topic branch from merge messages;
>an equivalent merge could have gone through as a fast-forward, and
>you'd never know.

Yeah, agreed. I made this more clear in my local version by changing the documentation from "scan for merges" to "scan first line of commit messages for possible merges". It's more wordy, but it make it clear that it is dependent on the message, and it's not tracked outside of that.

I also tend to merge topic branches with --no-ff so that I do get the merge message, so it has a better chance of working against my repository. (I also enjoy octopus merging when possible so the history indicates the patch sets are separable, but maybe I'm just a little "touched" and haven't been bitten by by an octopus yet.[1])

Not directly related to any issue you bring up:
There seems to be some needless redundancy between USAGE and OPTIONS_SPEC.
Would you object to a patch that used $USAGE inside OPTIONS_SPEC?
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss@iguanasuicide.net                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

[1] I hear they are even more feral than penguins.
Previous: Thomas RastNext: Thomas Rast
Message 38 of 46 in “checkout: implement "-" shortcut name for last branch”
  1. checkout: implement "-" shortcut name for last branchThomas Rast, Jan 15, 2009
  2. checkout: implement "-" shortcut name for last branchThomas Rast, Jan 15, 2009
  3. Johannes SixtJan 15, 2009
  4. Johannes SchindelinJan 15, 2009
  5. Thomas RastJan 15, 2009
  6. Johannes SchindelinJan 15, 2009
  7. Johannes SchindelinJan 15, 2009
  8. Junio C HamanoJan 15, 2009
  9. Johannes SchindelinJan 15, 2009
  10. revision walker: include a detached HEAD in --allJohannes Schindelin, Jan 16, 2009
  11. Santi BéjarJan 16, 2009
  12. Johannes SchindelinJan 16, 2009
  13. David KastrupJan 16, 2009
  14. Santi BéjarJan 16, 2009
  15. Santi BéjarJan 16, 2009
  16. Junio C HamanoJan 18, 2009
  17. Junio C HamanoJan 18, 2009
  18. Johannes SchindelinJan 18, 2009
  19. Johannes SchindelinJan 18, 2009
  20. Johan HerlandJan 15, 2009
  21. Johannes SchindelinJan 15, 2009
  22. Junio C HamanoJan 15, 2009
  23. Junio C HamanoJan 15, 2009
  24. Johannes SchindelinJan 16, 2009
  25. Johannes SchindelinJan 15, 2009
  26. Thomas RastJan 15, 2009
  27. Johannes SchindelinJan 15, 2009
  28. Thomas RastJan 15, 2009
  29. Johannes SchindelinJan 15, 2009
  30. Thomas RastJan 16, 2009
  31. Johannes SchindelinJan 16, 2009
  32. git-resurrect: find traces of a branch name and resurrect itThomas Rast, Jan 18, 2009
  33. Johannes SchindelinJan 18, 2009
  34. Thomas RastJan 20, 2009
  35. Boyd Stephen Smith Jr.Jan 20, 2009
  36. Boyd Stephen Smith Jr.Jan 20, 2009
  37. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Jan 23, 2009
  38. Boyd Stephen Smith Jr.Jan 23, 2009
  39. Thomas RastJan 26, 2009
  40. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Jan 26, 2009
  41. Junio C HamanoJan 27, 2009
  42. Thomas RastJan 30, 2009
  43. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Feb 1, 2009
  44. Junio C HamanoFeb 2, 2009
  45. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Feb 4, 2009
  46. Junio C HamanoFeb 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.