* [feature request] allow directly committing untracked files
@ 2025-08-23 6:45 Isaac Oscar Gariano
2025-08-23 15:43 ` brian m. carlson
2025-08-25 7:45 ` Michal Suchánek
0 siblings, 2 replies; 3+ messages in thread
From: Isaac Oscar Gariano @ 2025-08-23 6:45 UTC (permalink / raw)
To: git@vger•kernel.org
I often use 'git commit some-file -m 'some message'" to quickly make a commit, but this is annoying as it doesn't work if some-file is untracked, you first have to do 'git add some-file'.
It would also be nice to do this with the `-a` option as well.
Is there any reason why git does not let you do this?
Would people be open to me making a patch that ads this? Would it need to be behind an option for backwards-compatibility?
— Isaac Oscar Gariano
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [feature request] allow directly committing untracked files
2025-08-23 6:45 [feature request] allow directly committing untracked files Isaac Oscar Gariano
@ 2025-08-23 15:43 ` brian m. carlson
2025-08-25 7:45 ` Michal Suchánek
1 sibling, 0 replies; 3+ messages in thread
From: brian m. carlson @ 2025-08-23 15:43 UTC (permalink / raw)
To: Isaac Oscar Gariano; +Cc: git@vger•kernel.org
[-- Attachment #1: Type: text/plain, Size: 1834 bytes --]
On 2025-08-23 at 06:45:30, Isaac Oscar Gariano wrote:
> I often use 'git commit some-file -m 'some message'" to quickly make a commit, but this is annoying as it doesn't work if some-file is untracked, you first have to do 'git add some-file'.
> It would also be nice to do this with the `-a` option as well.
> Is there any reason why git does not let you do this?
I think we've seen a request for this before.
I will say that I always stage changes ahead of time because I'll often
work on a few different things before committing[0] and I always want to
be very sure what I'm including, but I know not everyone does that.
It's also the case that sometimes files end up not being properly
ignored[1], so it's very easy to accidentally include files that you
wouldn't ever want to commit.
> Would people be open to me making a patch that ads this? Would it need to be behind an option for backwards-compatibility?
I can see that it would be useful. For instance, it could be convenient
when writing tests of Git's behaviour where you really want to just
include everything in the directory.
It would definitely need to be behind an option. I might suggest
something like this:
git commit --include-untracked -m "message" some-file
Of course, we typically reserve a final opinion on a change until we see
a patch, since we're interested in both the idea behind the feature and
the implementation.
[0] For instance, at work, I was fixing some software tests to run
properly with reftable and I fixed several different files before
committing, each of which would have needed to be its own commit.
[1] I've seen this in codebases in which tests are only infrequently run
by hand and where the CI doesn't care about untracked files.
--
brian m. carlson (they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [feature request] allow directly committing untracked files
2025-08-23 6:45 [feature request] allow directly committing untracked files Isaac Oscar Gariano
2025-08-23 15:43 ` brian m. carlson
@ 2025-08-25 7:45 ` Michal Suchánek
1 sibling, 0 replies; 3+ messages in thread
From: Michal Suchánek @ 2025-08-25 7:45 UTC (permalink / raw)
To: Isaac Oscar Gariano; +Cc: git@vger•kernel.org
On Sat, Aug 23, 2025 at 06:45:30AM +0000, Isaac Oscar Gariano wrote:
> I often use 'git commit some-file -m 'some message'" to quickly make a commit, but this is annoying as it doesn't work if some-file is untracked, you first have to do 'git add some-file'.
> It would also be nice to do this with the `-a` option as well.
> Is there any reason why git does not let you do this?
> Would people be open to me making a patch that ads this? Would it need to be behind an option for backwards-compatibility?
Hello,
if the exposed index gets in your way you can consider some porcelain
that hides the index, such as jujutsu.
Thanks
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-25 7:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-23 6:45 [feature request] allow directly committing untracked files Isaac Oscar Gariano
2025-08-23 15:43 ` brian m. carlson
2025-08-25 7:45 ` Michal Suchánek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox