git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
To: <git@vger.kernel.org>
Subject: Surprising semantics of "git add file"
Date: Sun, 05 May 2019 22:02:18 +0200	[thread overview]
Message-ID: <5CCF414A020000A10003108C@gwsmtp.uni-regensburg.de> (raw)

Hi!

Reading the manual, I realized that "it is the way it is (it works as documented)", but to me it's surprising, meaning: I feel it's wrong:
(git-2.16.4)
I have staged several files, and then I do "git add -interactive file" to add some selected changes from file.
After that a "git diff --cached file" just shows the changes added interactively, but when I "git add file" to commit those changes), even the unstaged changes from file are committed.
I feel this is inconsistent: At least "git diff --cached file" should behave like "git commit file", meaning "git commit file" should be fixed IMHO.
Or are there any reasonable use cased for that?

Regards,
Ulrich Windl




             reply	other threads:[~2019-05-05 20:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05 20:02 Ulrich Windl [this message]
2019-05-05 20:12 ` Antw: Surprising semantics of "git add file" Ulrich Windl
2019-05-05 20:31 ` Andreas Schwab
2019-05-06  7:14   ` Antw: " Ulrich Windl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5CCF414A020000A10003108C@gwsmtp.uni-regensburg.de \
    --to=ulrich.windl@rz.uni-regensburg.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).