Move keymap to view ops and change to use a struct
[tig.git] / git.h
blob1430a959bdd2c5676bda0465dbca1378974c5fa7
1 /* Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>
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(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(context_arg, space_arg, new_name) \
26 GIT_DIFF_INITIAL("--cached", context_arg, space_arg, "", new_name)
28 #define GIT_DIFF_STAGED(context_arg, space_arg, old_name, new_name) \
29 "git", "diff-index", ENCODING_ARG, "--root", "--patch-with-stat", "-C", "-M", \
30 "--cached", (context_arg), (space_arg), "HEAD", "--", (old_name), (new_name), NULL
32 #define GIT_DIFF_UNSTAGED(context_arg, space_arg, old_name, new_name) \
33 "git", "diff-files", ENCODING_ARG, "--root", "--patch-with-stat", "-C", "-M", \
34 (context_arg), (space_arg), "--", (old_name), (new_name), NULL
36 /* Don't show staged unmerged entries. */
37 #define GIT_DIFF_STAGED_FILES(output_arg) \
38 "git", "diff-index", (output_arg), "--diff-filter=ACDMRTXB", "--cached", "-M", "HEAD", NULL
40 #define GIT_DIFF_UNSTAGED_FILES(output_arg) \
41 "git", "diff-files", (output_arg), NULL
43 #define GIT_DIFF_BLAME(context_arg, space_arg, new_name) \
44 GIT_DIFF_UNSTAGED(context_arg, space_arg, "", new_name)
46 #define GIT_DIFF_BLAME_NO_PARENT(context_arg, space_arg, new_name) \
47 GIT_DIFF_INITIAL("", context_arg, space_arg, "/dev/null", new_name)
49 #endif