From: Junio C Hamano <gitster@pobox.com>
To: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.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 16:34:02 -0700 [thread overview]
Message-ID: <xmqq8qmgpaxh.fsf@gitster.g> (raw)
In-Reply-To: <09518eac-948e-46be-9cd2-64304e78af81@app.fastmail.com> (Kristoffer Haugsbakk's message of "Tue, 27 May 2025 18:43:10 +0200")
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
> I have also not seen anyone really recommend using this option.
You mean "git commit -a"?
I actually do to anybody who is the kind of person who concentrates
on a single thing and completes that single thing well before moving
to another task. It is a perfect tool for the job for such a way of
working.
Like when doing "git merge" or "git pull". There, the "single
thing" that the person concentrates on is to complete the merge, and
with a reasonably written pre-commit hook to make sure there is no
leftover conflict markers [*], "git commit -a" to conclude a
conflicted merge is fairly safe.
[Footnote]
* There should actually be pre-add hook to make it even less
annoying. After you see conflicts, "git add -u" happily adds the
contents of the files in the working tree, with conflict markers
still in them. You can rely on the pre-commit hook that is
triggered when you run "git commit" next time, and then use "git
checkout -m" to recreate the conflicted higher-stage index
entries for these paths, but if we had pre-add hook, we shouldn't
have to know how to recover from such a mistake in the first
place.
prev parent reply other threads:[~2025-05-28 23:34 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
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 [this message]
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=xmqq8qmgpaxh.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kristofferhaugsbakk@fastmail.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).