From: Taylor Blau <me@ttaylorr.com>
To: Yuri <yuri@rawbw.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: 'git commit .' in a subdirectory also commits staged files in other subdirectories
Date: Fri, 21 Oct 2022 17:48:36 -0400 [thread overview]
Message-ID: <Y1MTtNcUHyv76UEV@nand.local> (raw)
In-Reply-To: <3a4dfad5-0f2e-14d8-61f2-779616de1ae0@tsoft.com>
Hi Yuri,
On Fri, Oct 21, 2022 at 12:40:51PM -0700, Yuri wrote:
> I had several staged files in various subdirectories of the cloned
> repository tree.
>
> 'git commit .' in one of them attempted to commit all of them, not
> only the files in that subdirectory.
>
> This is a very unreasonable behavior, because while being in any
> subdirectory 'git commit .' should only affect that subdirectory, and
> not files elsewhere.
That isn't right, though I can't reproduce what you describe from your
report. Try this script out:
--- >8 ---
#!/bin/sh
rm -fr repo
git init repo
cd repo
mkdir -p dir
touch dir/c
touch a
touch b
git add a b dir/c
git commit -m "a"
date >>b
date >>dir/c
(
cd dir
git commit . -m "dir"
)
--- 8< ---
`repo` ends up wtih the contents of dir/c committed, but b is still
modified (and its latest changes not part of the most recent commit).
Can you share a reproduction script?
Thanks,
Taylor
next prev parent reply other threads:[~2022-10-21 21:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 19:40 'git commit .' in a subdirectory also commits staged files in other subdirectories Yuri
2022-10-21 21:48 ` Taylor Blau [this message]
2022-10-21 22:02 ` Junio C Hamano
2022-11-07 18:45 ` Yuri
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=Y1MTtNcUHyv76UEV@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=yuri@rawbw.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.
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).