提交 02a20456 编写于 作者: J Junio C Hamano

Merge branch 'maint'

* maint:
  pager: default to LESS=FRSX not LESS=FRS
  Make prune also run prune-packed
  git-vc: better installation instructions
  gitweb: Do not esc_html $basedir argument to git_print_tree_entry
  gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)
  Fix usagestring for git-branch
  git-merge: show usage if run without arguments
......@@ -4,9 +4,7 @@
static const char prune_packed_usage[] =
"git-prune-packed [-n]";
static int dryrun;
static void prune_dir(int i, DIR *dir, char *pathname, int len)
static void prune_dir(int i, DIR *dir, char *pathname, int len, int dryrun)
{
struct dirent *de;
char hex[40];
......@@ -31,7 +29,7 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len)
rmdir(pathname);
}
static void prune_packed_objects(void)
void prune_packed_objects(int dryrun)
{
int i;
static char pathname[PATH_MAX];
......@@ -50,7 +48,7 @@ static void prune_packed_objects(void)
d = opendir(pathname);
if (!d)
continue;
prune_dir(i, d, pathname, len + 3);
prune_dir(i, d, pathname, len + 3, dryrun);
closedir(d);
}
}
......@@ -58,6 +56,7 @@ static void prune_packed_objects(void)
int cmd_prune_packed(int argc, const char **argv, const char *prefix)
{
int i;
int dryrun;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
......@@ -73,6 +72,6 @@ int cmd_prune_packed(int argc, const char **argv, const char *prefix)
usage(prune_packed_usage);
}
sync();
prune_packed_objects();
prune_packed_objects(dryrun);
return 0;
}
......@@ -255,5 +255,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
prune_object_dir(get_object_directory());
sync();
prune_packed_objects(show_only);
return 0;
}
......@@ -11,6 +11,7 @@ extern int mailinfo(FILE *in, FILE *out, int ks, const char *encoding, const cha
extern int split_mbox(const char **mbox, const char *dir, int allow_bare, int nr_prec, int skip);
extern void stripspace(FILE *in, FILE *out);
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
extern void prune_packed_objects(int);
extern int cmd_add(int argc, const char **argv, const char *prefix);
extern int cmd_apply(int argc, const char **argv, const char *prefix);
......
......@@ -23,7 +23,10 @@
;; system.
;;
;; To install: put this file on the load-path and add GIT to the list
;; of supported backends in `vc-handled-backends'.
;; of supported backends in `vc-handled-backends'; the following line,
;; placed in your ~/.emacs, will accomplish this:
;;
;; (add-to-list 'vc-handled-backends 'GIT)
;;
;; TODO
;; - changelog generation
......
#!/bin/sh
USAGE='[-l] [(-d | -D) <branchname>] | [[-f] <branchname> [<start-point>]] | -r'
USAGE='[-l] [-f] <branchname> [<start-point>] | (-d | -D) <branchname> | [-r]'
LONG_USAGE='If no arguments, show available branches and mark current branch with a star.
If one argument, create a new branch <branchname> based off of current HEAD.
If two arguments, create a new branch <branchname> based off of <start-point>.'
......
......@@ -93,6 +93,8 @@ finish () {
esac
}
case "$#" in 0) usage ;; esac
rloga=
while case "$#" in 0) break ;; esac
do
......
......@@ -2834,7 +2834,7 @@ sub git_tree {
my $refs = git_get_references();
my $ref = format_ref_marker($refs, $hash_base);
git_header_html();
my $base = "";
my $basedir = '';
my ($have_blame) = gitweb_check_feature('blame');
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
my @views_nav = ();
......@@ -2862,7 +2862,10 @@ sub git_tree {
print "<div class=\"title\">$hash</div>\n";
}
if (defined $file_name) {
$base = esc_html("$file_name/");
$basedir = $file_name;
if ($basedir ne '' && substr($basedir, -1) ne '/') {
$basedir .= '/';
}
}
git_print_page_path($file_name, 'tree', $hash_base);
print "<div class=\"page_body\">\n";
......@@ -2878,7 +2881,7 @@ sub git_tree {
}
$alternate ^= 1;
git_print_tree_entry(\%t, $base, $hash_base, $have_blame);
git_print_tree_entry(\%t, $basedir, $hash_base, $have_blame);
print "</tr>\n";
}
......
......@@ -50,7 +50,7 @@ void setup_pager(void)
close(fd[0]);
close(fd[1]);
setenv("LESS", "FRS", 0);
setenv("LESS", "FRSX", 0);
run_pager(pager);
die("unable to execute pager '%s'", pager);
exit(255);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册