committing selected 'changed' or 'added' files works, but not 'removed'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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'?
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux