mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Merge branch 'jc/c99' into next
* jc/c99: Cygwin needs NO_C99_FORMAT??? git-grep: document --and, --or, --not, ( and ) use declarations from builtin.h for builtin commands Make git-repo-config a builtin
This commit is contained in:
@@ -16,7 +16,7 @@ SYNOPSIS
|
||||
[-n] [-l | --files-with-matches] [-L | --files-without-match]
|
||||
[-c | --count]
|
||||
[-A <post-context>] [-B <pre-context>] [-C <context>]
|
||||
[-f <file>] [-e] <pattern>
|
||||
[-f <file>] [-e] <pattern> [--and|--or|--not|(|)|-e <pattern>...]
|
||||
[<tree>...]
|
||||
[--] [<path>...]
|
||||
|
||||
@@ -74,16 +74,30 @@ OPTIONS
|
||||
-e::
|
||||
The next parameter is the pattern. This option has to be
|
||||
used for patterns starting with - and should be used in
|
||||
scripts passing user input to grep.
|
||||
scripts passing user input to grep. Multiple patterns are
|
||||
combined by 'or'.
|
||||
|
||||
--and | --or | --not | ( | )::
|
||||
Specify how multiple patterns are combined using boolean
|
||||
expressions. `--or` is the default operator. `--and` has
|
||||
higher precedence than `--or`. `-e` has to be used for all
|
||||
patterns.
|
||||
|
||||
`<tree>...`::
|
||||
Search blobs in the trees for specified patterns.
|
||||
|
||||
`--`::
|
||||
\--::
|
||||
Signals the end of options; the rest of the parameters
|
||||
are <path> limiters.
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
git grep -e \'#define\' --and \( -e MAX_PATH -e PATH_MAX \)::
|
||||
Looks for a line that has `#define` and either `MAX_PATH` or
|
||||
`PATH_MAX`.
|
||||
|
||||
Author
|
||||
------
|
||||
Originally written by Linus Torvalds <torvalds@osdl.org>, later
|
||||
|
||||
8
Makefile
8
Makefile
@@ -204,7 +204,7 @@ PROGRAMS = \
|
||||
git-unpack-objects$X git-update-server-info$X \
|
||||
git-upload-pack$X git-verify-pack$X \
|
||||
git-symbolic-ref$X \
|
||||
git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \
|
||||
git-name-rev$X git-pack-redundant$X git-var$X \
|
||||
git-describe$X git-merge-tree$X git-blame$X git-imap-send$X \
|
||||
git-merge-recur$X
|
||||
|
||||
@@ -217,7 +217,8 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X git-update-ref$X \
|
||||
git-read-tree$X git-commit-tree$X git-write-tree$X \
|
||||
git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \
|
||||
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
|
||||
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X
|
||||
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
|
||||
git-repo-config$X
|
||||
|
||||
# what 'all' will build and 'install' will install, in gitexecdir
|
||||
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
|
||||
@@ -274,7 +275,7 @@ BUILTIN_OBJS = \
|
||||
builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \
|
||||
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
|
||||
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
|
||||
builtin-mv.o builtin-prune-packed.o
|
||||
builtin-mv.o builtin-prune-packed.o builtin-repo-config.o
|
||||
|
||||
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
|
||||
EXTLIBS = -lz
|
||||
@@ -336,6 +337,7 @@ ifeq ($(uname_O),Cygwin)
|
||||
NO_STRLCPY = YesPlease
|
||||
NO_SYMLINK_HEAD = YesPlease
|
||||
NEEDS_LIBICONV = YesPlease
|
||||
NO_C99_FORMAT = YesPlease
|
||||
# There are conflicting reports about this.
|
||||
# On some boxes NO_MMAP is needed, and not so elsewhere.
|
||||
# Try uncommenting this if you see things break -- YMMV.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "builtin.h"
|
||||
#include "cache.h"
|
||||
#include "commit.h"
|
||||
#include "diff.h"
|
||||
@@ -242,7 +243,7 @@ static void shortlog(const char *name, unsigned char *sha1,
|
||||
free_list(&subjects);
|
||||
}
|
||||
|
||||
int cmd_fmt_merge_msg(int argc, char **argv, const char *prefix)
|
||||
int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
int limit = 20, i = 0;
|
||||
char line[1024];
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "builtin.h"
|
||||
#include "cache.h"
|
||||
|
||||
static const char prune_packed_usage[] =
|
||||
@@ -54,7 +55,7 @@ static void prune_packed_objects(void)
|
||||
}
|
||||
}
|
||||
|
||||
int cmd_prune_packed(int argc, char **argv, const char *prefix)
|
||||
int cmd_prune_packed(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "builtin.h"
|
||||
#include "cache.h"
|
||||
#include <regex.h>
|
||||
|
||||
@@ -128,7 +129,7 @@ free_strings:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
int cmd_repo_config(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
int nongit = 0;
|
||||
setup_git_directory_gently(&nongit);
|
||||
@@ -48,6 +48,7 @@ extern int cmd_update_index(int argc, const char **argv, const char *prefix);
|
||||
extern int cmd_update_ref(int argc, const char **argv, const char *prefix);
|
||||
extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
|
||||
extern int cmd_mv(int argc, const char **argv, const char *prefix);
|
||||
extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
|
||||
|
||||
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
|
||||
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
|
||||
|
||||
Reference in New Issue
Block a user