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

Re: [PATCH 2/2] read-tree: at least one tree-ish argument is required

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 18, 2009, 20:13 UTC
Message-ID
<7vy6l0ujkx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<fabb9a1e0912181159u65ae9c6fg1481ab744575475f@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
Show 10 quoted lines
> On Fri, Dec 18, 2009 at 13:49, Junio C Hamano <gitster@pobox.com> wrote:
>> You might type
>> "commit" when you meant to say "commit -a" and record an incomplete state;
>> it is "dangerous" in that sense.
>
> Speaking of which, it has hit me multiple times that I craft out a
> commit with 'git add -p' and then do "git commit -am 'foo some bars'"
> and lose all my hard work (because I'm used to typing 'git commit -am'
> for temporary commits). I'd be happy if "git commit -am" learned to
> second-guess me when I already have something in the index.

Sounds like "commit.confirm = xxx" configuration patches are coming? What other questionable operations we might want to let users configure git to ask for confirmation?

Show 6 quoted lines
> Fair enough, then perhaps it is time for "core.nodataloss" which
> either logs states to a seperate reflog (so that you can go back to
> the state you were in before doing 'git read-tree') or interactively
> informs the user that this will command will result in data loss
> (although that sounds a tad too much like Window's "Are you sure?"
> dialogs).

I somehow suspect that you had your morning coffee yet ;-) Aren't we talking about the index, and why are you bringing up the reflog?

More importantly, if you accept that there are non-interrogator commands in the git command set, I somehow suspect that you will soon realize that "git config core.nodataloss true" is equivalent to "chmod a-w -R .". It might be useful mode of non-operation (read-only historical archive) but I do not think it deserves a configuration of its own with checks in the code all over the place that might possibly change any states of the repository.

"git config user.novice true" to increase the verbosity and degree of hand-holding is an entirely different matter, but if that is what you are advocating, you shouldn't call it "core.nodataloss".

Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 11 of 21 in “filter-branch: remove an unnecessary use of 'git read-tree'”
  1. 1/2 filter-branch: remove an unnecessary use of 'git read-tree'Johannes Sixt, Dec 15, 2009
  2. 2/2 read-tree: at least one tree-ish argument is requiredJohannes Sixt, Dec 15, 2009
  3. Johannes SixtDec 18, 2009
  4. Junio C HamanoDec 18, 2009
  5. Johannes SixtDec 18, 2009
  6. Sverre RabbelierDec 18, 2009
  7. Junio C HamanoDec 18, 2009
  8. Sverre RabbelierDec 18, 2009
  9. Junio C HamanoDec 18, 2009
  10. Sverre RabbelierDec 18, 2009
  11. Junio C HamanoDec 18, 2009
  12. Sverre RabbelierDec 18, 2009
  13. Johannes SixtDec 18, 2009
  14. Jakub NarebskiDec 18, 2009
  15. Junio C HamanoDec 18, 2009
  16. Nanako ShiraishiDec 19, 2009
  17. Junio C HamanoDec 19, 2009
  18. Junio C HamanoDec 19, 2009
  19. Johannes SchindelinDec 19, 2009
  20. Johannes SchindelinDec 15, 2009
  21. Junio C HamanoDec 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.