From: Michael <git-scm@webhippo.net>
To: <git@vger.kernel.org>
Subject: Bug Report: Creating a hardlink to any of the file in git repo cause the source file to show up in git commit message editor under "Changes not staged for commit" section.
Date: Sun, 17 Jul 2011 20:42:52 -0700 [thread overview]
Message-ID: <02a20a168c52beb42e57258bcc5c0551@mail.mxes.net> (raw)
Creating a hardlink to any of the file in git repo cause the source
file
to show up in git commit message editor under "Changes not staged for
commit"
section.
Reproduced on:
Ubuntu 10.04, Gentoo, FreeBSD
Git version: 1.7.6
Bug has been observed by atleast 3 people.
Follow these steps to reproduce:
# create test repo
cd /tmp
mkdir -p test-repo/repo
cd test-repo/repo
git init
git config user.name "Foo"
git config user.email "foo@example.com"
# put some files in the repo
touch FILE1 FILE2 FILE3 FILE4 FILE5
git add -A
git commit -m "initial commit"
# create git hook that hardlink FILE2 and FILE3 and remove the
hardlinks
# right then and there
echo "ln -vf FILE2 ../HARDLINK_TO_FILE2" >| .git/hooks/pre-commit
echo "rm -vf ../HARDLINK_TO_FILE2" >> .git/hooks/pre-commit
echo "ln -vf FILE3 ../HARDLINK_TO_FILE3" >> .git/hooks/pre-commit
echo "rm -vf ../HARDLINK_TO_FILE3" >> .git/hooks/pre-commit
# make pre-commit executable
chmod u+x .git/hooks/pre-commit
# modify FILE1
echo "hello world" >> FILE1
# run git status
git status
-------------------------------------------------------------------------------
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: FILE1
#
no changes added to commit (use "git add" and/or "git commit -a")
-------------------------------------------------------------------------------
# try commit using nano as commit editor and without usin -a flag
VISUAL=nano git commit FILE1
# Despite the fact that they are modified FILE2 and FILE3 will show in
the
# commit message, under "Changes not staged for commit" section
# like so:
--------------------------------------------------------------------------------
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Explicit paths specified without -i nor -o; assuming --only paths...
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: FILE1
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: FILE2
# modified: FILE3
#
--------------------------------------------------------------------------------
In case anyone interested, tor me this happens when I do a python EGG
build
which hardlinks files in order to build.
-- Michael
next reply other threads:[~2011-07-18 3:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 3:42 Michael [this message]
2011-07-18 18:37 ` Bug Report: Creating a hardlink to any of the file in git repo cause the source file to show up in git commit message editor under "Changes not staged for commit" section Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2011-07-18 3:24 Michael
2011-07-18 20:12 ` Andreas Schwab
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=02a20a168c52beb42e57258bcc5c0551@mail.mxes.net \
--to=git-scm@webhippo.net \
--cc=git@vger.kernel.org \
/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).