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

Re: [HELP] Adding git awareness to the darning patch management system.

From
Jeff King <peff@peff.net>
Date
Dec 1, 2011, 23:40 UTC
Message-ID
<20111201234042.GA7294@sigill.intra.peff.net>
In-Reply-To
<4ED80EA2.80805@users.sourceforge.net>
On Fri, Dec 02, 2011 at 09:32:50AM +1000, Peter Williams wrote:
Show 9 quoted lines
> Yes, I think your right.  For most of my purposes, I think that it's
> irrelevant whether a change is staged or not and the choices that I
> offer allow the user to do what he thinks is right for a file with
> changes that are staged but uncommitted.  For me to automatically do
> something based on whether the file was staged for a commit would be
> a mistake as I would be reducing the user's options.
> 
> However, the distinction might be worth making in the file tree
> display to remind the user what's staged and what's not?

I'd personally start with ignoring the distinction, and then wait for some enterprising user to suggest how it would be marked. That takes the burden off of you for guessing what representation would be best.

> As an aside, I found it easier to delve into git's innards to find
> out how to implement git binary patches than I did finding out how to
> do things from the CLI :-).

Heh. I think that is because the CLI is written by people (myself included) who want it to give them access to git's innards. ;)

Show 8 quoted lines
> >In your case, I think "status" is the most convenient level of
> >abstraction for you, because you are interesting in looking at
> >differences to both the index and HEAD (i.e., the prior commit). But if
> >you find as you implement that want more flexibility, you can switch to
> >using the lower-level commands yourself.
> 
> I'll investigate this approach.  How easy is it to distinguish low
> level commands from high level commands?

git(1) has a list of "porcelain" and "plumbing" commands. If you are scripting, you generally want to stick with plumbing commands, lower-level whose output and behavior remains stable across releases.

However, some porcelain commands offer a "plumbing" mode (despite the name, the "--porcelain" flag to some commands is what you want; it is about offering parseable output that a custom porcelain could use. In git lingo, your interface is one such porcelain).

-Peff
Previous: Peter WilliamsNext: Tay Ray Chuan
Message 6 of 8 in “[HELP] Adding git awareness to the darning patch management system.”
  1. Peter WilliamsNov 30, 2011
  2. Jeff KingNov 30, 2011
  3. Peter WilliamsDec 1, 2011
  4. Jeff KingDec 1, 2011
  5. Peter WilliamsDec 1, 2011
  6. Jeff KingDec 1, 2011
  7. Tay Ray ChuanNov 30, 2011
  8. Peter WilliamsNov 30, 2011

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.