Add commit boundary marker to custom pretty log format
[tig.git] / include / tig / git.h
blob4febe446ea2aebb935cf43d63e9427280b02661a
1 /* Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #ifndef TIG_GIT_H
15 #define TIG_GIT_H
18 * Argv-style git command macros.
21 #define GIT_DIFF_INITIAL(encoding_arg, cached_arg, context_arg, space_arg, old_name, new_name) \
22 "git", "diff", (encoding_arg), "--no-color", "--patch-with-stat", \
23 (cached_arg), (context_arg), (space_arg), "--", (old_name), (new_name), NULL
25 #define GIT_DIFF_STAGED_INITIAL(encoding_arg, context_arg, space_arg, new_name) \
26 GIT_DIFF_INITIAL(encoding_arg, "--cached", context_arg, space_arg, "", new_name)
28 #define GIT_DIFF_STAGED(encoding_arg, context_arg, space_arg, old_name, new_name) \
29 "git", "diff-index", (encoding_arg), "--root", "--patch-with-stat", "-C", "-M", \
30 "--cached", "--diff-filter=ACDMRTXB", (context_arg), (space_arg), "HEAD", \
31 "--", (old_name), (new_name), NULL
33 #define GIT_DIFF_UNSTAGED(encoding_arg, context_arg, space_arg, old_name, new_name) \
34 "git", "diff-files", (encoding_arg), "--root", "--patch-with-stat", "-C", "-M", \
35 (context_arg), (space_arg), "--", (old_name), (new_name), NULL
37 /* Don't show staged unmerged entries. */
38 #define GIT_DIFF_STAGED_FILES(output_arg) \
39 "git", "diff-index", (output_arg), "--diff-filter=ACDMRTXB", "-C", "--cached", "HEAD", "--", NULL
41 #define GIT_DIFF_UNSTAGED_FILES(output_arg) \
42 "git", "diff-files", (output_arg), NULL
44 #define GIT_DIFF_BLAME(encoding_arg, context_arg, space_arg, new_name) \
45 GIT_DIFF_UNSTAGED(encoding_arg, context_arg, space_arg, "", new_name)
47 #define GIT_DIFF_BLAME_NO_PARENT(encoding_arg, context_arg, space_arg, new_name) \
48 GIT_DIFF_INITIAL(encoding_arg, "", context_arg, space_arg, "/dev/null", new_name)
50 #define GIT_MAIN_LOG(encoding_arg, commit_order_arg, diffargs, revargs, fileargs, pretty_arg) \
51 "git", "log", (encoding_arg), \
52 (commit_order_arg), (diffargs), (revargs), "--date=raw", "--parents", \
53 "--no-color", (pretty_arg), "--", (fileargs), NULL
55 #define GIT_MAIN_LOG_CUSTOM(encoding_arg, commit_order_arg, diffargs, revargs, fileargs) \
56 GIT_MAIN_LOG(encoding_arg, commit_order_arg, diffargs, revargs, fileargs, \
57 "--pretty=format:commit %m %H %P%x00%an <%ae> %ad%x00%s")
59 #define GIT_MAIN_LOG_RAW(encoding_arg, commit_order_arg, diffargs, revargs, fileargs) \
60 GIT_MAIN_LOG(encoding_arg, commit_order_arg, diffargs, revargs, fileargs, \
61 "--pretty=raw")
63 #endif
65 /* vim: set ts=8 sw=8 noexpandtab: */