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
Sverre Rabbelier <srabbelier@gmail.com>
Date
Dec 18, 2009, 20:21 UTC
Message-ID
<fabb9a1e0912181221i31c32a76n50581adfb2185037@mail.gmail.com>
In-Reply-To
<7vy6l0ujkx.fsf@alter.siamese.dyndns.org>
Heya,
On Fri, Dec 18, 2009 at 14:13, Junio C Hamano <gitster@pobox.com> wrote:
> Sounds like "commit.confirm = xxx" configuration patches are coming?
Not a bad idea.
> What
> other questionable operations we might want to let users configure git to
> ask for confirmation?

I don't see any other of the above category, that is, the category of operations that contain 'git commit -a' with a non-empty index, and 'git rm' on a modified file (which we already prevent). But see below.

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

It was a topic hijack of sorts, we were talking about data loss. I brought up the reflog since I think that was mentioned before when we discussed ways to prevent data loss (e.g., create a commit of the current state when doing 'git reset --hard' and record it in such a 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 .".

I don't think that's quite right, since you don't lose any data if you do only additive commands (e.g., create new commits, etc).

> 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.

That is not quite what I intended with 'core.preventdataloss' (which I agree is a bad name for what I intend with it). I meant for a configuration option which insures that all non-interrogation commands make sure that what they throw away is recoverable (for example through the reflog).

> "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".

I'm not sure I'd call it "user.novice", since I don't consider myself a novice user, and I would definitely like to be able to recover data that I accidentally deleted with 'git reset --hard'.

-- 
Cheers,

Sverre Rabbelier
Previous: Junio C HamanoNext: Johannes Sixt
Message 12 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.