threads / patch / 6101

patch, 5 partsgit-add/git-rm updates

Subject: [PATCH 0/5] git-add/git-rm updates

## tl;dr

One message between Dec 25, 2006 and Dec 25, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Junio C Hamano· Dec 25, 2006, 11:09 UTC · lore

This series futzes with a pair of functions in dir.c machinery and enhances git-add and git-rm command.

[PATCH 1/5] match_pathspec() -- return how well the spec matched

The function match_pathspec() takes the pathspec given from the command line and tells if a given name matches it. This enhances its return value so that the command can tell how well the name matches. Earlier, the caller could not tell if matched pathspec was exactly the same as the name, was a fileglob that matched the name, or was a leading directory.

[PATCH 2/5] git-rm: update to saner semantics [PATCH 3/5] t3600: update the test for updated git rm

This updates git-rm to saner semantics Linus suggested on the list earlier, and updates the tests. When a path is removed, it is removed both from the working tree and from the index. As a safety measure, the path is required to be cache-clean, and also must match the HEAD (unless it is before the initial commit on the branch).

[PATCH 4/5] read_directory: show_both option.

The function read_directory() is the workhorse to traverse working tree while taking '.gitignore' into account. This updates the function to allow callers that are interested in both ignored and non-ignored paths to get both paths so that it can do its own filtering on the result.

[PATCH 5/5] git-add: add ignored files when asked explicitly.

One thing many people found confusing about git-add was that a file whose name matches an ignored pattern could not be added. This is an RFC fix for the problem.

← back to recent threads