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

Re: [PATCH 4/4] replace: add a --raw mode for --edit

From
Jeff King <peff@peff.net>
Date
Jun 25, 2014, 10:24 UTC
Message-ID
<20140625102454.GA5130@sigill.intra.peff.net>
In-Reply-To
<CAPig+cRKxwJ64=qFAtefonutmZuURpTRZyjyjSaxcpuinRGL4g@mail.gmail.com>
On Tue, Jun 24, 2014 at 09:40:09PM -0400, Eric Sunshine wrote:
Show 15 quoted lines
> On Tue, Jun 24, 2014 at 5:46 AM, Jeff King <peff@peff.net> wrote:
> > One of the purposes of "git replace --edit" is to help a
> > user repair objects which are malformed or corrupted.
> > Usually we pretty-print trees with "ls-tree", which is much
> > easier to work with than the raw binary data.  However, some
> > forms of corruption break the tree-walker, in which case our
> > pretty-printing fails, rendering "--edit" useless for the
> > user.
> >
> > This patch introduces a "--raw" option, which lets you edit
> > the binary data in these instances.
> 
> Is there a possibility that any of the other git-replace modes will
> grow a need for "raw"? If not, would it make sense to make this
> specific to "edit" as --edit=raw?

I doubt that any other modes will want it, as it is about the pretty-printing step which is pretty specific to --edit. However, making it "--edit=raw" also precludes adding other "modes" to --edit. I do not have any in mind, but I do not see it as impossible.

Preclude is maybe a strong word. You could have "--edit=raw,flag1,flag2", but then we are essentially reinventing an option parser inside --edit's value. Not to mention that you cannot do "--no-raw", even without other flags being added.

-Peff
Previous: Eric SunshineNext: Junio C Hamano
Message 7 of 9 in “git replace --edit --raw”
  1. 0/4 git replace --edit --rawJeff King, Jun 24, 2014
  2. 1/4 replace: replace spaces with tabs in indentationJeff King, Jun 24, 2014
  3. 2/4 avoid double close of descriptors handed to run_commandJeff King, Jun 24, 2014
  4. 3/4 replace: use argv_array in export_objectJeff King, Jun 24, 2014
  5. 4/4 replace: add a --raw mode for --editJeff King, Jun 24, 2014
  6. Eric SunshineJun 25, 2014
  7. Jeff KingJun 25, 2014
  8. Junio C HamanoJun 25, 2014
  9. Jeff KingJun 26, 2014

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.