mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
d1df574380
This patch introduces a new program, diff-tree-helper. It reads output from diff-cache and diff-tree, and produces a patch file. The diff format customization can be done the same way the show-diff uses; the same external diff interface introduced by the previous patch to drive diff from show-diff is used so this is not surprising. It is used like the following examples: $ diff-cache --cached -z <tree> | diff-tree-helper -z -R paths... $ diff-tree -r -z <tree1> <tree2> | diff-tree-helper -z paths... - As usual, the use of the -z flag is recommended in the script to pass NUL-terminated filenames through the pipe between commands. - The -R flag is used to generate reverse diff. It does not matter for diff-tree case, but it is sometimes useful to get a patch in the desired direction out of diff-cache. - The paths parameters are used to restrict the paths that appears in the output. Again this is useful to use with diff-cache, which, unlike diff-tree, does not take such paths restriction parameters. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
13 lines
225 B
C
13 lines
225 B
C
#ifndef STRBUF_H
|
|
#define STRBUF_H
|
|
struct strbuf {
|
|
int alloc;
|
|
int len;
|
|
int eof;
|
|
unsigned char *buf;
|
|
};
|
|
|
|
extern void strbuf_init(struct strbuf *);
|
|
extern void read_line(struct strbuf *, FILE *, int);
|
|
|
|
#endif /* STRBUF_H */
|