From: Junio C Hamano <gitster@pobox.com>
To: Nico Williams <nico@cryptonector.com>
Cc: Jon Forrest <nobozo@gmail.com>, git@vger.kernel.org
Subject: Re: "git commit -a" Doesn't Add New Files. Why?
Date: Wed, 28 May 2025 15:24:02 -0700 [thread overview]
Message-ID: <xmqqjz60pe65.fsf@gitster.g> (raw)
In-Reply-To: <aDXo0Enj4cQzKQkK@ubby> (Nico Williams's message of "Tue, 27 May 2025 11:31:12 -0500")
Nico Williams <nico@cryptonector.com> writes:
> On Tue, May 27, 2025 at 09:03:55AM -0700, Jon Forrest wrote:
>> The documentation clearly says that running "git commit -a"
>> doesn't add new files to the index. I wonder why that choice
>> was made.
>
> I use `git commit -a` all the time in workspaces that are dirty. It
> would be exceedingly annoying if `git commit -a` were to act like `git
> add . && git commit`.
True, but not quite. You would want your "git add ." to be safe in
dirty working trees---at least some folks wanted so badly enough
that "git add ." pays attention to the ".gitignore" mechanism.
But `git commit -a` would not change, even if it won't add cruft
with well curated .gitignore files. That will be a terrible
backward incompatible change for those who expect it only deals with
the files it knows about (including the one that is not yet tracked
but its presence is known via "git add -N").
next prev parent reply other threads:[~2025-05-28 22:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 16:03 "git commit -a" Doesn't Add New Files. Why? Jon Forrest
2025-05-27 16:31 ` Nico Williams
2025-05-28 22:24 ` Junio C Hamano [this message]
2025-05-28 23:06 ` Jon Forrest
2025-05-27 16:43 ` Kristoffer Haugsbakk
2025-05-28 21:16 ` Junio C Hamano
2025-05-28 23:34 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqjz60pe65.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=nico@cryptonector.com \
--cc=nobozo@gmail.com \
/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.
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 NNTP newsgroup(s).