From fc61e313da0a124e9f6a213cd76944a8c4e6c918 Mon Sep 17 00:00:00 2001 From: Rene Scharfe Date: Sat, 21 Oct 2006 20:51:04 +0200 Subject: git-merge: show usage if run without arguments Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano diff --git a/git-merge.sh b/git-merge.sh index 5b34b4d..789f4de 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -93,6 +93,8 @@ finish () { esac } +case "$#" in 0) usage ;; esac + rloga= while case "$#" in 0) break ;; esac do -- cgit v0.10.2-6-g49f6 From 5ea0921cbeb248a6505c32601ad841f706f942fd Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sun, 22 Oct 2006 13:30:24 +0200 Subject: Fix usagestring for git-branch Signed-off-by: Lars Hjemli Signed-off-by: Junio C Hamano diff --git a/git-branch.sh b/git-branch.sh index 4f31903..f823c78 100755 --- a/git-branch.sh +++ b/git-branch.sh @@ -1,6 +1,6 @@ #!/bin/sh -USAGE='[-l] [(-d | -D) ] | [[-f] []] | -r' +USAGE='[-l] [-f] [] | (-d | -D) | [-r]' LONG_USAGE='If no arguments, show available branches and mark current branch with a star. If one argument, create a new branch based off of current HEAD. If two arguments, create a new branch based off of .' -- cgit v0.10.2-6-g49f6 From e7fb022a42a83cbdb33e40f82ffca28eceb423c9 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sat, 21 Oct 2006 17:52:19 +0200 Subject: gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2) Code should be aligned the same way, regardless of tab size. Use tabs for indent, but spaces for align. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 0ec1eef..d01ac94 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1671,13 +1671,13 @@ sub git_print_tree_entry { if ($t->{'type'} eq "blob") { print "" . $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'}, - file_name=>"$basedir$t->{'name'}", %base_key), - -class => "list"}, esc_html($t->{'name'})) . "\n"; + file_name=>"$basedir$t->{'name'}", %base_key), + -class => "list"}, esc_html($t->{'name'})) . "\n"; print ""; if ($have_blame) { print $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'}, - file_name=>"$basedir$t->{'name'}", %base_key)}, - "blame"); + file_name=>"$basedir$t->{'name'}", %base_key)}, + "blame"); } if (defined $hash_base) { if ($have_blame) { @@ -1689,8 +1689,8 @@ sub git_print_tree_entry { } print " | " . $cgi->a({-href => href(action=>"blob_plain", hash_base=>$hash_base, - file_name=>"$basedir$t->{'name'}")}, - "raw"); + file_name=>"$basedir$t->{'name'}")}, + "raw"); print "\n"; } elsif ($t->{'type'} eq "tree") { @@ -1758,7 +1758,7 @@ sub git_difftree_body { print ""; print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'}, hash_base=>$hash, file_name=>$diff{'file'}), - -class => "list"}, esc_html($diff{'file'})); + -class => "list"}, esc_html($diff{'file'})); print "\n"; print "$mode_chng\n"; print ""; @@ -1785,11 +1785,11 @@ sub git_difftree_body { print " | "; } print $cgi->a({-href => href(action=>"blame", hash_base=>$parent, - file_name=>$diff{'file'})}, - "blame") . " | "; + file_name=>$diff{'file'})}, + "blame") . " | "; print $cgi->a({-href => href(action=>"history", hash_base=>$parent, - file_name=>$diff{'file'})}, - "history"); + file_name=>$diff{'file'})}, + "history"); print "\n"; } elsif ($diff{'status'} eq "M" || $diff{'status'} eq "T") { # modified, or type changed @@ -1810,8 +1810,8 @@ sub git_difftree_body { } print ""; print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'}, - hash_base=>$hash, file_name=>$diff{'file'}), - -class => "list"}, esc_html($diff{'file'})); + hash_base=>$hash, file_name=>$diff{'file'}), + -class => "list"}, esc_html($diff{'file'})); print "\n"; print "$mode_chnge\n"; print ""; @@ -1822,19 +1822,19 @@ sub git_difftree_body { print $cgi->a({-href => "#patch$patchno"}, "patch"); } else { print $cgi->a({-href => href(action=>"blobdiff", - hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'}, - hash_base=>$hash, hash_parent_base=>$parent, - file_name=>$diff{'file'})}, - "diff"); + hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'}, + hash_base=>$hash, hash_parent_base=>$parent, + file_name=>$diff{'file'})}, + "diff"); } print " | "; } print $cgi->a({-href => href(action=>"blame", hash_base=>$hash, - file_name=>$diff{'file'})}, - "blame") . " | "; + file_name=>$diff{'file'})}, + "blame") . " | "; print $cgi->a({-href => href(action=>"history", hash_base=>$hash, - file_name=>$diff{'file'})}, - "history"); + file_name=>$diff{'file'})}, + "history"); print "\n"; } elsif ($diff{'status'} eq "R" || $diff{'status'} eq "C") { # renamed or copied @@ -1862,19 +1862,19 @@ sub git_difftree_body { print $cgi->a({-href => "#patch$patchno"}, "patch"); } else { print $cgi->a({-href => href(action=>"blobdiff", - hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'}, - hash_base=>$hash, hash_parent_base=>$parent, - file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})}, - "diff"); + hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'}, + hash_base=>$hash, hash_parent_base=>$parent, + file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})}, + "diff"); } print " | "; } print $cgi->a({-href => href(action=>"blame", hash_base=>$parent, - file_name=>$diff{'from_file'})}, - "blame") . " | "; + file_name=>$diff{'from_file'})}, + "blame") . " | "; print $cgi->a({-href => href(action=>"history", hash_base=>$parent, - file_name=>$diff{'from_file'})}, - "history"); + file_name=>$diff{'from_file'})}, + "history"); print "\n"; } # we should not encounter Unmerged (U) or Unknown (X) status @@ -2800,7 +2800,7 @@ sub git_tree { # FIXME: Should be available when we have no hash base as well. push @views_nav, $cgi->a({-href => href(action=>"snapshot", hash=>$hash)}, - "snapshot"); + "snapshot"); } git_print_page_nav('tree','', $hash_base, undef, undef, join(' | ', @views_nav)); git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base); -- cgit v0.10.2-6-g49f6 From 300454feaba846b6bf95625c607d7096d81d26eb Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sat, 21 Oct 2006 17:53:09 +0200 Subject: gitweb: Do not esc_html $basedir argument to git_print_tree_entry In git_tree, rename $base variable (which is passed as $basedir argument to git_print_tree_entry) to $basedir. Do not esc_html $basedir, as it is part of file_name ('f') argument in link and not printed. Add '/' at the end only if $basedir is not empty (it is empty for top directory) and doesn't end in '/' already. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index d01ac94..23b26a2 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2783,7 +2783,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 = (); @@ -2811,7 +2811,10 @@ sub git_tree { print "
$hash
\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 "
\n"; @@ -2827,7 +2830,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 "\n"; } -- cgit v0.10.2-6-g49f6 From 474a90fef9ebcdedee041b2def4b9a98b94cd146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Hasselstr=C3=B6m?= Date: Sun, 22 Oct 2006 20:46:36 +0200 Subject: git-vc: better installation instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provide some more detailed installation instructions, for the elisp-challenged among us. Signed-off-by: Karl Hasselström Signed-off-by: Junio C Hamano diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el index 4189c4c..80e7675 100644 --- a/contrib/emacs/vc-git.el +++ b/contrib/emacs/vc-git.el @@ -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 -- cgit v0.10.2-6-g49f6 From 2eb53e65bd9cdd3b76a6447a1a51dee6e5de96a3 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Sun, 22 Oct 2006 19:01:23 -0400 Subject: Make prune also run prune-packed Both the git-prune manpage and everday.txt say that git-prune should also prune unpacked objects that are also found in packs, by running git prune-packed. Junio thought this was "a regression when prune was rewritten as a built-in." So modify prune to call prune-packed again. Signed-off-by: J. Bruce Fields diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c index 960db49..e12b6cf 100644 --- a/builtin-prune-packed.c +++ b/builtin-prune-packed.c @@ -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; } diff --git a/builtin-prune.c b/builtin-prune.c index 6228c79..7290e6d 100644 --- a/builtin-prune.c +++ b/builtin-prune.c @@ -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; } diff --git a/builtin.h b/builtin.h index f9fa9ff..f71b962 100644 --- a/builtin.h +++ b/builtin.h @@ -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); -- cgit v0.10.2-6-g49f6 From 0abc0260fa3419de649fcc1444e3d256a17ca6c7 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 22 Oct 2006 20:28:10 -0700 Subject: pager: default to LESS=FRSX not LESS=FRS Signed-off-by: Junio C Hamano diff --git a/pager.c b/pager.c index 8bd33a1..4587fbb 100644 --- a/pager.c +++ b/pager.c @@ -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); -- cgit v0.10.2-6-g49f6