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

Re: [RFC PATCH 0/1] Introduce git-recover

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 5, 2018, 01:34 UTC
Message-ID
<20180805013422.GC258270@aiede.svl.corp.google.com>
In-Reply-To
<20180804142247.GA7@e3c0ce5ceb57>
Hi,
Edward Thomson wrote:
Show 5 quoted lines
> I created a simple shell script a while back to help people recover
> files that they deleted from their working directory (but had been added
> to the repository), which looks for unreachable blobs in the object
> database and places them in the working directory (either en masse,
> interactively, or via command-line arguments).

Cool! Most of this belongs in the commit message, which is part of why I always discourage having a separate cover letter in single-patch series.

Show 14 quoted lines
> This has been available at https://github.com/ethomson/git-recover for
> about a year, and in that time, someone has suggested that I propose
> this as part of git itself.  So I thought I'd see if there's any
> interest in this.
>
> If there is, I'd like to get a sense of the amount of work required to
> make this suitable for inclusion.  There are some larger pieces of work
> required -- at a minimum, I think this requires:
>
> - Tests -- there are none, which is fine with me but probably less fine
>   for inclusion here.
> - Documentation -- the current README is below but it will need proper
>   documentation that can be rendered into manpages, etc, by the tools.
> - Remove bashisms -- there are many.

One possible path in that direction would be to "stage" the code in contrib/ first, while documenting the intention of graduating to a command in git itself. Then the list can pitch in with those tasks. There are good reasons for a tool to exist outside of Git, so I wouldn't recommend this unless we have a clear plan for its graduation that we've agreed upon as a project, but thought I should mention it as a mechanism in case we decide to do that.

The trend these days for Git commands has been to prefer to have them in C. Portable shell is a perfectly fine stopping point on the way there, though.

My more fundamental main thought is separate from those logistics: how does this relate to "git fsck --lost-found"? What would your ideal interface to solve this problem look like? Can we make Git's commands complement each other in a good way to solve it well?

Thanks, Jonathan

Previous: Todd Zullinger
Message 8 of 8 in “Introduce git-recover”
  1. 0/1 Introduce git-recoverEdward Thomson, Aug 4, 2018
  2. 1/1 recover: restoration of deleted worktree filesEdward Thomson, Aug 4, 2018
  3. Junio C HamanoAug 4, 2018
  4. Edward ThomsonAug 4, 2018
  5. Junio C HamanoAug 4, 2018
  6. Robert P. J. DayAug 4, 2018
  7. Todd ZullingerAug 4, 2018
  8. Jonathan NiederAug 5, 2018

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.