From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Luis Ressel <aranea@aixah.de>
Cc: git@vger.kernel.org
Subject: Re: [feature request] Make "commit --only" work with new files
Date: Mon, 28 Nov 2016 15:09:34 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1611281505270.117539@virtualbox> (raw)
In-Reply-To: <20161125175619.19e13e59@gentp.lnet>
Hi Luis,
On Fri, 25 Nov 2016, Luis Ressel wrote:
> currently "git commit --only <file>" only works if <file> is already
> checked into the repo, but not with newly created and still untracked
> files (builtin/commit.c:list_path() throws the error "error: pathspec
> '<file>' did not match any file(s) known to git.")
>
> I don't think this limitation is intented. I've had a look at the
> relevant part of builtin/commit.c, but unfortunately it wasn't obvious
> to me how to fix this.
The best way to go about it is probably to define the desired behavior
first, in the form of a patch to the test suite. Personally, I would
extend t/t7509-commit.sh with a new test case.
Then, once you have that test case (that should be marked with
test_expect_failure, because it fails for now), you can use a debugger
such as gdb to single-step into the relevant function (I guess
"prepare_index()" is a good candidate) to find out why the files are not
added.
From there, it should be easier to figure out what to patch, and how.
Good hunting!
Johannes
next prev parent reply other threads:[~2016-11-28 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 16:56 [feature request] Make "commit --only" work with new files Luis Ressel
2016-11-28 14:09 ` Johannes Schindelin [this message]
2016-11-28 17:52 ` Junio C Hamano
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=alpine.DEB.2.20.1611281505270.117539@virtualbox \
--to=johannes.schindelin@gmx.de \
--cc=aranea@aixah.de \
--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).