From: Yuri <yuri@rawbw.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: 'git commit .' in a subdirectory also commits staged files in other subdirectories
Date: Mon, 7 Nov 2022 10:45:20 -0800 [thread overview]
Message-ID: <7766c9c8-1323-70fb-c6d2-efca6b77595f@tsoft.com> (raw)
In-Reply-To: <Y1MTtNcUHyv76UEV@nand.local>
On 10/21/22 14:48, Taylor Blau wrote:
> That isn't right, though I can't reproduce what you describe from your
> report. Try this script out:
I don't know how to reproduce this on purpose. But I just got another
instance of the problem.
I am in the FreeBSD ports Git repository, in the math/cimod subfolder.
Another subfolder, audio/sonic-visualiser, also has changes.
Here is the command:
[yuri@yv /disk-samsung/freebsd-ports/math/cimod]$ git commit .
hint: Waiting for your editor to close the file...
# Uncomment and add a short description of why things changed.
math/cimod: Update 1.4.43 -> 1.4.45
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# category/port: Subject goes here, max 50 cols -|
# <then a blank line>
# 72 columns --|
#
# Do not add a Submitted by line. If someone besides the committer sent
in the
# change, the commit author should be set using `git commit --author`.
#
# Uncomment and complete these metadata fields, as appropriate:
#
# PR: <If and which Problem Report is related.>
Reported by: portscout
# Reviewed by: <If someone else reviewed your modification.>
# Tested by: <If someone else tested the change.>
# Approved by: <If you needed approval for this commit.>
# Obtained from: <If the change is from a third party.>
# Fixes: <Short hash and title line of commit fixed by this change>
# MFH: <Ports tree branch name you plan to merge to.>
# Relnotes: <Set to 'yes' for mention in release notes.>
# Security: <Vulnerability reference (one per line) or description.>
# Sponsored by: <If the change was sponsored by an organization.>
# Pull Request: <https://github.com/freebsd/freebsd-ports/pull/###>
# Differential Revision: <https://reviews.freebsd.org/D###>
#
# "Pull Request" and "Differential Revision" require the *full* GitHub or
# Phabricator URL.
#
# On branch main
# Your branch is up to date with 'origin/main'.
#
# Changes to be committed:
# modified: Makefile
# modified: distinfo
#
# Changes not staged for commit:
# modified: ../../audio/sonic-visualiser/Makefile
# modified: ../../audio/sonic-visualiser/distinfo
# deleted: ../../audio/sonic-visualiser/files/patch-acinclude.m4
# deleted: ../../audio/sonic-visualiser/files/patch-base.pro
# deleted: ../../audio/sonic-visualiser/files/patch-config.pri.in
# deleted: ../../audio/sonic-visualiser/files/patch-configure.ac
# deleted: ../../audio/sonic-visualiser/files/patch-convert.pro
# deleted: ../../audio/sonic-visualiser/files/patch-server.pro
# deleted:
../../audio/sonic-visualiser/files/patch-sonic-visualiser.pro
Git said that 2 files are to be committed, Makefile and distnfo. This is
correct.
However, the resulting commit also has audio/sonic-visualiser:
git diff 99f39b9798ff81b8fb529bea7c16d96e27aecfca~1
99f39b9798ff81b8fb529bea7c16d96e27aecfca | grep diff
diff --git a/audio/sonic-visualiser/files/patch-acinclude.m4
b/audio/sonic-visualiser/files/patch-acinclude.m4
diff --git a/audio/sonic-visualiser/files/patch-base.pro
b/audio/sonic-visualiser/files/patch-base.pro
diff --git a/audio/sonic-visualiser/files/patch-config.pri.in
b/audio/sonic-visualiser/files/patch-config.pri.in
diff --git a/audio/sonic-visualiser/files/patch-configure.ac
b/audio/sonic-visualiser/files/patch-configure.ac
diff --git a/audio/sonic-visualiser/files/patch-convert.pro
b/audio/sonic-visualiser/files/patch-convert.pro
diff --git a/audio/sonic-visualiser/files/patch-server.pro
b/audio/sonic-visualiser/files/patch-server.pro
diff --git a/audio/sonic-visualiser/files/patch-sonic-visualiser.pro
b/audio/sonic-visualiser/files/patch-sonic-visualiser.pro
- # (because of the difficulty of getting them running nicely in the
diff --git a/audio/sonic-visualiser/files/patch-sv.pro
b/audio/sonic-visualiser/files/patch-sv.pro
diff --git a/audio/sonic-visualiser/files/patch-svapp_acinclude.m4
b/audio/sonic-visualiser/files/patch-svapp_acinclude.m4
diff --git a/audio/sonic-visualiser/files/patch-svcore_acinclude.m4
b/audio/sonic-visualiser/files/patch-svcore_acinclude.m4
diff --git a/audio/sonic-visualiser/files/patch-svcore_config.pri.in
b/audio/sonic-visualiser/files/patch-svcore_config.pri.in
diff --git a/audio/sonic-visualiser/files/patch-svgui_acinclude.m4
b/audio/sonic-visualiser/files/patch-svgui_acinclude.m4
diff --git
a/audio/sonic-visualiser/files/patch-svgui_layer_WaveformLayer.cpp
b/audio/sonic-visualiser/files/patch-svgui_layer_WaveformLayer.cpp
diff --git a/audio/sonic-visualiser/files/patch-svgui_view_Overview.cpp
b/audio/sonic-visualiser/files/patch-svgui_view_Overview.cpp
diff --git a/math/cimod/Makefile b/math/cimod/Makefile
diff --git a/math/cimod/distinfo b/math/cimod/distinfo
This is WRONG!
There *is* a bug in Git.
Each commit needs to be individually checked to see if the right files
were committed. The Git's commit description can't be trusted.
When it says "Changes not staged for commit" - these files should *not*
be committed,
This has already hurt me several times.
This should be the highest priority bug.
Yuri
prev parent reply other threads:[~2022-11-07 18:45 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
2022-10-21 22:02 ` Junio C Hamano
2022-11-07 18:45 ` Yuri [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=7766c9c8-1323-70fb-c6d2-efca6b77595f@tsoft.com \
--to=yuri@rawbw.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.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).