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
This commit is contained in:
@ -4,9 +4,7 @@
|
|||||||
static const char prune_packed_usage[] =
|
static const char prune_packed_usage[] =
|
||||||
"git-prune-packed [-n]";
|
"git-prune-packed [-n]";
|
||||||
|
|
||||||
static int dryrun;
|
static void prune_dir(int i, DIR *dir, char *pathname, int len, int dryrun)
|
||||||
|
|
||||||
static void prune_dir(int i, DIR *dir, char *pathname, int len)
|
|
||||||
{
|
{
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
char hex[40];
|
char hex[40];
|
||||||
@ -31,7 +29,7 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len)
|
|||||||
rmdir(pathname);
|
rmdir(pathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prune_packed_objects(void)
|
void prune_packed_objects(int dryrun)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
static char pathname[PATH_MAX];
|
static char pathname[PATH_MAX];
|
||||||
@ -50,7 +48,7 @@ static void prune_packed_objects(void)
|
|||||||
d = opendir(pathname);
|
d = opendir(pathname);
|
||||||
if (!d)
|
if (!d)
|
||||||
continue;
|
continue;
|
||||||
prune_dir(i, d, pathname, len + 3);
|
prune_dir(i, d, pathname, len + 3, dryrun);
|
||||||
closedir(d);
|
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 cmd_prune_packed(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
int dryrun;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
const char *arg = argv[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);
|
usage(prune_packed_usage);
|
||||||
}
|
}
|
||||||
sync();
|
sync();
|
||||||
prune_packed_objects();
|
prune_packed_objects(dryrun);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -255,5 +255,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
|
|||||||
|
|
||||||
prune_object_dir(get_object_directory());
|
prune_object_dir(get_object_directory());
|
||||||
|
|
||||||
|
sync();
|
||||||
|
prune_packed_objects(show_only);
|
||||||
return 0;
|
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 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 void stripspace(FILE *in, FILE *out);
|
||||||
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
|
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_add(int argc, const char **argv, const char *prefix);
|
||||||
extern int cmd_apply(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.
|
;; system.
|
||||||
;;
|
;;
|
||||||
;; To install: put this file on the load-path and add GIT to the list
|
;; 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
|
;; TODO
|
||||||
;; - changelog generation
|
;; - changelog generation
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/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.
|
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 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>.'
|
If two arguments, create a new branch <branchname> based off of <start-point>.'
|
||||||
|
@ -93,6 +93,8 @@ finish () {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "$#" in 0) usage ;; esac
|
||||||
|
|
||||||
rloga=
|
rloga=
|
||||||
while case "$#" in 0) break ;; esac
|
while case "$#" in 0) break ;; esac
|
||||||
do
|
do
|
||||||
|
@ -2834,7 +2834,7 @@ sub git_tree {
|
|||||||
my $refs = git_get_references();
|
my $refs = git_get_references();
|
||||||
my $ref = format_ref_marker($refs, $hash_base);
|
my $ref = format_ref_marker($refs, $hash_base);
|
||||||
git_header_html();
|
git_header_html();
|
||||||
my $base = "";
|
my $basedir = '';
|
||||||
my ($have_blame) = gitweb_check_feature('blame');
|
my ($have_blame) = gitweb_check_feature('blame');
|
||||||
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
|
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
|
||||||
my @views_nav = ();
|
my @views_nav = ();
|
||||||
@ -2862,7 +2862,10 @@ sub git_tree {
|
|||||||
print "<div class=\"title\">$hash</div>\n";
|
print "<div class=\"title\">$hash</div>\n";
|
||||||
}
|
}
|
||||||
if (defined $file_name) {
|
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);
|
git_print_page_path($file_name, 'tree', $hash_base);
|
||||||
print "<div class=\"page_body\">\n";
|
print "<div class=\"page_body\">\n";
|
||||||
@ -2878,7 +2881,7 @@ sub git_tree {
|
|||||||
}
|
}
|
||||||
$alternate ^= 1;
|
$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";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
2
pager.c
2
pager.c
@ -50,7 +50,7 @@ void setup_pager(void)
|
|||||||
close(fd[0]);
|
close(fd[0]);
|
||||||
close(fd[1]);
|
close(fd[1]);
|
||||||
|
|
||||||
setenv("LESS", "FRS", 0);
|
setenv("LESS", "FRSX", 0);
|
||||||
run_pager(pager);
|
run_pager(pager);
|
||||||
die("unable to execute pager '%s'", pager);
|
die("unable to execute pager '%s'", pager);
|
||||||
exit(255);
|
exit(255);
|
||||||
|
Reference in New Issue
Block a user