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

Re: [PATCH] Fix file mark handling and sort side-effects in git.el

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Feb 15, 2009, 17:08 UTC
Message-ID
<87ocx3hbkq.fsf@wine.dyndns.org>
In-Reply-To
<18836.22386.987021.484807@hungover.brentg.com>
Brent Goodrick <bgoodr@gmail.com> writes:
> My rationale for adding append function calls to the sort calls is to
> leave the callers value alone since the caller needs to make use of
> the list value in subsequent operations, especially for issuing
> messages.

My point is that the callers that need it should take care of it themselves, instead of forcing a copy even in cases where it's not necessary. And the copy can most likely be avoided completely by changing how the success message is printed.

Show 10 quoted lines
>  > If you mean using git-add-file to do an update-index on an already
>  > tracked file, that's not what it's meant to do.
>
> That would be fine in, say, Perforce where once a file is added it
> stays added even if the user mades additional edits. I don't agree
> that is the best approach in the case the Emacs interface to git in
> git.el, since there is that "third" state where I could have added the
> file, then edited it, then forgot that I had edited it and proceeded
> naively to commit, only to be surprised later that the subsequent edit
> to the file was not committed. 

The design of git.el is that the index is not exposed directly, it's treated as an implementation detail. So "add" in git.el is only for adding an untracked file, it's not for updating the index contents of an already tracked file; that's an unnecessary operation since git.el uses the file marks to determine what gets committed.

It does get a bit confusing if you constantly mix command-line and git.el commands, but you are not supposed to do that, you should be able to do everything from the git.el buffer. I'm sure hiding the index offends the git purists, but IMHO it makes things more Emacs-ish and easier to use, especially if you are used to things like dired or pcl-cvs or vc-dir with other VC systems.

-- 
Alexandre Julliard
julliard@winehq.org
Previous: Brent GoodrickNext: Brent Goodrick
Message 4 of 7 in “Fix file mark handling and sort side-effects in git.el”
  1. Fix file mark handling and sort side-effects in git.elBrent Goodrick, Feb 11, 2009
  2. Alexandre JulliardFeb 11, 2009
  3. Brent GoodrickFeb 12, 2009
  4. Alexandre JulliardFeb 15, 2009
  5. Brent GoodrickFeb 15, 2009
  6. Alexandre JulliardFeb 15, 2009
  7. Brent GoodrickFeb 16, 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.