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