Staging
v0.5.2
https://github.com/git/git
Revision c63777c0d7687a1edff2c0da307ad8ac1d75c8f6 authored by Junio C Hamano on 06 May 2007, 04:18:57 UTC, committed by Junio C Hamano on 06 May 2007, 05:40:27 UTC
When you do this, existing "blame -C -C" would not find that the
latter half of the file2 came from the existing file1:

	... both file1 and file2 are tracked ...
	$ cat file1 >>file2
	$ git add file1 file2
	$ git commit

This is because we avoid the expensive find-copies-harder code
that makes unchanged file (in this case, file1) as a candidate
for copy & paste source when annotating an existing file
(file2).  The third -C now allows it.  However, this obviously
makes the process very expensive.  We've actually seen this
patch before, but I dismissed it because it covers such a narrow
(and arguably stupid) corner case.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent dd166aa
Raw File
Tip revision: c63777c0d7687a1edff2c0da307ad8ac1d75c8f6 authored by Junio C Hamano on 06 May 2007, 04:18:57 UTC
blame: -C -C -C
Tip revision: c63777c
archive.h
#ifndef ARCHIVE_H
#define ARCHIVE_H

#define MAX_EXTRA_ARGS	32
#define MAX_ARGS	(MAX_EXTRA_ARGS + 32)

struct archiver_args {
	const char *base;
	struct tree *tree;
	const unsigned char *commit_sha1;
	time_t time;
	const char **pathspec;
	unsigned int verbose : 1;
	void *extra;
};

typedef int (*write_archive_fn_t)(struct archiver_args *);

typedef void *(*parse_extra_args_fn_t)(int argc, const char **argv);

struct archiver {
	const char *name;
	struct archiver_args args;
	write_archive_fn_t write_archive;
	parse_extra_args_fn_t parse_extra;
};

extern int parse_archive_args(int argc,
			      const char **argv,
			      struct archiver *ar);

extern void parse_treeish_arg(const char **treeish,
			      struct archiver_args *ar_args,
			      const char *prefix);

extern void parse_pathspec_arg(const char **pathspec,
			       struct archiver_args *args);
/*
 * Archive-format specific backends.
 */
extern int write_tar_archive(struct archiver_args *);
extern int write_zip_archive(struct archiver_args *);
extern void *parse_extra_zip_args(int argc, const char **argv);

#endif	/* ARCHIVE_H */
back to top