diff options
author | Russell Belfer <rb@github.com> | 2013-06-20 12:16:06 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-06-20 12:16:06 -0700 |
commit | 22b6b82f2c0d95ce7a433394a6c0574a5714cf4c (patch) | |
tree | 432b4d109e004ed816127b9d22e2b8e706da75b0 /include/git2 | |
parent | cf300bb9e50c65e4140f7e204243b34f2898fa95 (diff) | |
download | libgit2-22b6b82f2c0d95ce7a433394a6c0574a5714cf4c.tar.gz |
Add status flags to force output sort order
Files in status will, be default, be sorted according to the case
insensitivity of the filesystem that we're running on. However,
in some cases, this is not desirable. Even on case insensitive
file systems, 'git status' at the command line will generally use
a case sensitive sort (like 'ls'). Some GUIs prefer to display a
list of file case insensitively even on case-sensitive platforms.
This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY
and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the
default sort order of the status output and give the user control.
This includes tests for exercising these new options and makes
the examples/status.c program emulate core Git and always use a
case sensitive sort.
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/status.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/git2/status.h b/include/git2/status.h index 282b606cb..63aea2f3b 100644 --- a/include/git2/status.h +++ b/include/git2/status.h @@ -111,6 +111,12 @@ typedef enum { * - GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR indicates tha rename * detection should be run between the index and the working directory * and enabled GIT_STATUS_WT_RENAMED as a possible status flag. + * - GIT_STATUS_OPT_SORT_CASE_SENSITIVELY overrides the native case + * sensitivity for the file system and forces the output to be in + * case-sensitive order + * - GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY overrides the native case + * sensitivity for the file system and forces the output to be in + * case-insensitive order * * Calling `git_status_foreach()` is like calling the extended version * with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED, @@ -127,6 +133,8 @@ typedef enum { GIT_STATUS_OPT_RECURSE_IGNORED_DIRS = (1u << 6), GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX = (1u << 7), GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR = (1u << 8), + GIT_STATUS_OPT_SORT_CASE_SENSITIVELY = (1u << 9), + GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY = (1u << 10), } git_status_opt_t; #define GIT_STATUS_OPT_DEFAULTS \ |