Git development
 help / color / mirror / Atom feed
* committing selected 'changed' or 'added' files works, but not 'removed'
@ 2007-05-14  6:16 Jim Meyering
  2007-05-14  7:44 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Meyering @ 2007-05-14  6:16 UTC (permalink / raw)
  To: git

Hello,

If I've just run "git-rm -f c" in a directory with a few modified
or git-added files, is there some way to commit (non-interactively)
only the removal of that selected file?  I.e., not any other changes
in the working directory?  git-commit -m. -- c fails with this:

  error: pathspec 'c' did not match any file(s) known to git

If I use "cg-commit" instead of "git-commit", it works fine.

When I asked on IRC, "cehteh" suggested to create a temporary branch,
do the removal there, and then to rebase that change back onto the
original branch -- and to remove the disposable branch.  Yes, that works,
but I want do the job with a single commit command, the same way I can
for "added" and "modified" files.  And I've been trying (until now,
successfully) to wean myself away from cogito.

Why should "removed" files be handled so differently?  If I cannot commit
a selected "file removal" (regardless of the state of the index), then
isn't that an opportunity to add a feature?

In case you're wondering, I want this functionality in order to make
a version control agnostic commit/diff/ChangeLog tool work the same way
with raw git as it did using cogito.

-------------------------------------------
In case an actual scenario helps, I'd like to be able to commit the
removal of "c", below without also committing the change to "b":

mkdir .j && cd .j && git-init > /dev/null && touch b c && git-add b c \
  && git-commit -q -m. && echo > b && git-rm --quiet -f c \
  && git-commit -m. -- c

The final commit above fails like this:

  error: pathspec 'c' did not match any file(s) known to git.
  Did you forget to 'git add'?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-14 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-14  6:16 committing selected 'changed' or 'added' files works, but not 'removed' Jim Meyering
2007-05-14  7:44 ` Junio C Hamano
2007-05-14 12:48   ` Jim Meyering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox