Merge branch 'cc/help'
authorJunio C Hamano <gitster@pobox.com>
Sat, 15 Mar 2008 08:10:32 +0000 (01:10 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 15 Mar 2008 08:10:32 +0000 (01:10 -0700)
* cc/help:
Documentation/git-help: typofix
help: warn if specified 'man.viewer' is unsupported, instead of erroring out
Documentation: help: explain 'man.viewer' multiple values
help: implement multi-valued "man.viewer" config option
Documentation: help: describe 'man.viewer' config variable
help: add "man.viewer" config var to use "woman" or "konqueror"

39 files changed:
Documentation/config.txt
Documentation/git-add.txt
Documentation/git-gc.txt
Documentation/git-web--browse.txt
Documentation/manpage-1.72.xsl
builtin-fetch.c
builtin-gc.c
builtin-log.c
builtin-merge-file.c
builtin-merge-recursive.c
builtin-pack-objects.c
builtin-read-tree.c
builtin-shortlog.c
commit.h
config.mak.in
configure.ac
contrib/workdir/git-new-workdir
git-compat-util.h
git-cvsimport.perl
git-quiltimport.sh
git-svn.perl
git-web--browse.sh
git.c
gitk-git/Makefile
gitk-git/gitk
gitk-git/po/it.po [new file with mode: 0644]
log-tree.c
log-tree.h
pretty.c
sha1_name.c
t/t1410-reflog.sh
t/t4021-format-patch-signer-mime.sh
t/t4028-format-patch-mime-headers.sh [new file with mode: 0755]
t/t4201-shortlog.sh
t/t5304-prune.sh
t/t6031-merge-recursive.sh [new file with mode: 0755]
unpack-trees.c
unpack-trees.h
xdiff-interface.c
index ae1486da3d812e16e35c5ffbe2e03f12bbde0774..0865f4e01a7d37c102dced01120798b79af4f4b1 100644 (file)
@@ -420,6 +420,11 @@ branch.<name>.rebase::
        it unless you understand the implications (see linkgit:git-rebase[1]
        for details).
 
+browser.<tool>.cmd::
+       Specify the command to invoke the specified browser. The
+       specified command is evaluated in shell with the URLs passed
+       as arguments. (See linkgit:git-web--browse[1].)
+
 browser.<tool>.path::
        Override the path for the given tool that may be used to
        browse HTML help (see '-w' option in linkgit:git-help[1]) or a
@@ -590,6 +595,10 @@ gc.packrefs::
        at some stage, and setting this to `false` will continue to
        prevent `git pack-refs` from being run from `git gc`.
 
+gc.pruneexpire::
+       When `git gc` is run, it will call `prune --expire 2.weeks.ago`.
+       Override the grace period with this config variable.
+
 gc.reflogexpire::
        `git reflog expire` removes reflog entries older than
        this time; defaults to 90 days.
@@ -864,7 +873,7 @@ pack.indexVersion::
        whenever the corresponding pack is larger than 2 GB.  Otherwise
        the default is 1.
 
-pack.packSizeLimit:
+pack.packSizeLimit::
        The default maximum size of a pack.  This setting only affects
        packing to a file, i.e. the git:// protocol is unaffected.  It
        can be overridden by the `\--max-pack-size` option of
index 47799097ce97da34fac60eafabd25576e077e362..c751a17d079dc2a6c5d3160573a42a7b6be3d5e2 100644 (file)
@@ -207,16 +207,14 @@ patch::
   and the working tree file and asks you if you want to stage
   the change of each hunk.  You can say:
 
-       y - add the change from that hunk to index
-       n - do not add the change from that hunk to index
-       a - add the change from that hunk and all the rest to index
-       d - do not the change from that hunk nor any of the rest to index
-       j - do not decide on this hunk now, and view the next
-           undecided hunk
-       J - do not decide on this hunk now, and view the next hunk
-       k - do not decide on this hunk now, and view the previous
-           undecided hunk
-       K - do not decide on this hunk now, and view the previous hunk
+       y - stage this hunk
+       n - do not stage this hunk
+       a - stage this and all the remaining hunks in the file
+       d - do not stage this hunk nor any of the remaining hunks in the file
+       j - leave this hunk undecided, see next undecided hunk
+       J - leave this hunk undecided, see next hunk
+       k - leave this hunk undecided, see previous undecided hunk
+       K - leave this hunk undecided, see previous hunk
        s - split the current hunk into smaller hunks
        ? - print help
 +
index 2e7be916aa5dede578b181e06457189551c16240..229a7c9b30482eb2d8729b581004bc776fa10edf 100644 (file)
@@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository
 
 SYNOPSIS
 --------
-'git-gc' [--prune] [--aggressive] [--auto] [--quiet]
+'git-gc' [--aggressive] [--auto] [--quiet]
 
 DESCRIPTION
 -----------
@@ -25,17 +25,6 @@ operating performance. Some git commands may automatically run
 OPTIONS
 -------
 
---prune::
-       Usually `git-gc` packs refs, expires old reflog entries,
-       packs loose objects,
-       and removes old 'rerere' records.  Removal
-       of unreferenced loose objects is an unsafe operation
-       while other git operations are in progress, so it is not
-       done by default.  Pass this option if you want it, and only
-       when you know nobody else is creating new objects in the
-       repository at the same time (e.g. never use this option
-       in a cron script).
-
 --aggressive::
        Usually 'git-gc' runs very quickly while providing good disk
        space utilization and performance.  This option will cause
@@ -104,6 +93,10 @@ the value, the more time is spent optimizing the delta compression.  See
 the documentation for the --window' option in linkgit:git-repack[1] for
 more details.  This defaults to 10.
 
+The optional configuration variable 'gc.pruneExpire' controls how old
+the unreferenced loose objects have to be before they are pruned.  The
+default is "2 weeks ago".
+
 See Also
 --------
 linkgit:git-prune[1]
index df57d010e5d999930ceaee1384a769bd1a8b2157..ddbae5b194790d7f76b53885e3d4ea642fda034a 100644 (file)
@@ -27,6 +27,8 @@ The following browsers (or commands) are currently supported:
 * dillo
 * open (this is the default under Mac OS X GUI)
 
+Custom commands may also be specified.
+
 OPTIONS
 -------
 -b BROWSER|--browser=BROWSER::
@@ -43,16 +45,35 @@ OPTIONS
 CONFIGURATION VARIABLES
 -----------------------
 
+CONF.VAR (from -c option) and web.browser
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 The web browser can be specified using a configuration variable passed
 with the -c (or --config) command line option, or the 'web.browser'
 configuration variable if the former is not used.
 
+browser.<tool>.path
+~~~~~~~~~~~~~~~~~~~
+
 You can explicitly provide a full path to your preferred browser by
 setting the configuration variable 'browser.<tool>.path'. For example,
 you can configure the absolute path to firefox by setting
 'browser.firefox.path'. Otherwise, 'git-web--browse' assumes the tool
 is available in PATH.
 
+browser.<tool>.cmd
+~~~~~~~~~~~~~~~~~~
+
+When the browser, specified by options or configuration variables, is
+not among the supported ones, then the corresponding
+'browser.<tool>.cmd' configuration variable will be looked up. If this
+variable exists then "git web--browse" will treat the specified tool
+as a custom command and will use a shell eval to run the command with
+the URLs passed as arguments.
+
+Note about git config --global
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 Note that these configuration variables should probably be set using
 the '--global' flag, for example like this:
 
index fe3cd72d6f6bfde6e5071c68814e2e985cba8c6c..4065a3a27a38be73132b9f509e1d63546b3fddef 100644 (file)
@@ -1,5 +1,9 @@
-<!-- callout.xsl: converts asciidoc callouts to man page format -->
+<!-- Based on callouts.xsl. Fixes man page callouts for DocBook 1.72 XSL -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<xsl:param name="man.output.quietly" select="1"/>
+<xsl:param name="refentry.meta.get.quietly" select="1"/>
+
 <xsl:template match="co">
        <xsl:value-of select="concat('&#x2593;fB(',substring-after(@id,'-'),')&#x2593;fR')"/>
 </xsl:template>
index 55f611e3c26e55df43eca1f40df74d335c850cc0..b2b9935ed65cfa80daf9f9071a3dd5d381ef3426 100644 (file)
@@ -40,6 +40,8 @@ static struct option builtin_fetch_options[] = {
                    "force overwrite of local branch"),
        OPT_SET_INT('t', "tags", &tags,
                    "fetch all tags and associated objects", TAGS_SET),
+       OPT_SET_INT('n', NULL, &tags,
+                   "do not fetch all tags (--no-tags)", TAGS_UNSET),
        OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"),
        OPT_BOOLEAN('u', "update-head-ok", &update_head_ok,
                    "allow updating of HEAD ref"),
index 045bf0e487a73e98d8d78990fcf85cc25ad5f96d..95917d74a873065bf9f928da37aa40e9e0d1f688 100644 (file)
@@ -26,12 +26,13 @@ static int pack_refs = 1;
 static int aggressive_window = -1;
 static int gc_auto_threshold = 6700;
 static int gc_auto_pack_limit = 20;
+static char *prune_expire = "2.weeks.ago";
 
 #define MAX_ADD 10
 static const char *argv_pack_refs[] = {"pack-refs", "--all", "--prune", NULL};
 static const char *argv_reflog[] = {"reflog", "expire", "--all", NULL};
 static const char *argv_repack[MAX_ADD] = {"repack", "-d", "-l", NULL};
-static const char *argv_prune[] = {"prune", NULL};
+static const char *argv_prune[] = {"prune", "--expire", NULL, NULL};
 static const char *argv_rerere[] = {"rerere", "gc", NULL};
 
 static int gc_config(const char *var, const char *value)
@@ -55,6 +56,17 @@ static int gc_config(const char *var, const char *value)
                gc_auto_pack_limit = git_config_int(var, value);
                return 0;
        }
+       if (!strcmp(var, "gc.pruneexpire")) {
+               if (!value)
+                       return config_error_nonbool(var);
+               if (strcmp(value, "now")) {
+                       unsigned long now = approxidate("now");
+                       if (approxidate(value) >= now)
+                               return error("Invalid %s: '%s'", var, value);
+               }
+               prune_expire = xstrdup(value);
+               return 0;
+       }
        return git_default_config(var, value);
 }
 
@@ -234,7 +246,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        if (run_command_v_opt(argv_repack, RUN_GIT_CMD))
                return error(FAILED_RUN, argv_repack[0]);
 
-       if (prune && run_command_v_opt(argv_prune, RUN_GIT_CMD))
+       argv_prune[2] = prune_expire;
+       if (run_command_v_opt(argv_prune, RUN_GIT_CMD))
                return error(FAILED_RUN, argv_prune[0]);
 
        if (run_command_v_opt(argv_rerere, RUN_GIT_CMD))
index d983cbc7bc98f1b28332c18946e5111a6dcba9ab..5c00725f030460ba34c702b9ad31e577ca70d361 100644 (file)
@@ -662,6 +662,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
        int i;
        const char *encoding = "utf-8";
        struct diff_options opts;
+       int need_8bit_cte = 0;
 
        if (rev->commit_format != CMIT_FMT_EMAIL)
                die("Cover letter needs email format");
@@ -672,7 +673,8 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 
        head_sha1 = sha1_to_hex(head->object.sha1);
 
-       log_write_email_headers(rev, head_sha1, &subject_start, &extra_headers);
+       log_write_email_headers(rev, head_sha1, &subject_start, &extra_headers,
+                               &need_8bit_cte);
 
        committer = git_committer_info(0);
 
@@ -681,7 +683,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
        pp_user_info(NULL, CMIT_FMT_EMAIL, &sb, committer, DATE_RFC2822,
                     encoding);
        pp_title_line(CMIT_FMT_EMAIL, &msg, &sb, subject_start, extra_headers,
-                     encoding, 0);
+                     encoding, need_8bit_cte);
        pp_remainder(CMIT_FMT_EMAIL, &msg, &sb, 0);
        printf("%s\n", sb.buf);
 
index adce6d4635a4153428368073677cd74a9bafc045..3605960c2d9692514a6df0f344f3c3269cf1de3c 100644 (file)
@@ -57,7 +57,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
 
                if (!f)
                        ret = error("Could not open %s for writing", filename);
-               else if (fwrite(result.ptr, result.size, 1, f) != 1)
+               else if (result.size &&
+                        fwrite(result.ptr, result.size, 1, f) != 1)
                        ret = error("Could not write to %s", filename);
                else if (fclose(f))
                        ret = error("Could not close %s", filename);
index 5c7fbb2599d07ad7415ae8dfef205356ac3b0bbb..910c0d20e7ba1128c705a49bfd9966212c5420b2 100644 (file)
@@ -668,9 +668,20 @@ static struct merge_file_info merge_file(struct diff_filespec *o,
                if (!sha_eq(a->sha1, o->sha1) && !sha_eq(b->sha1, o->sha1))
                        result.merge = 1;
 
-               result.mode = a->mode == o->mode ? b->mode: a->mode;
+               /*
+                * Merge modes
+                */
+               if (a->mode == b->mode || a->mode == o->mode)
+                       result.mode = b->mode;
+               else {
+                       result.mode = a->mode;
+                       if (b->mode != o->mode) {
+                               result.clean = 0;
+                               result.merge = 1;
+                       }
+               }
 
-               if (sha_eq(a->sha1, o->sha1))
+               if (sha_eq(a->sha1, b->sha1) || sha_eq(a->sha1, o->sha1))
                        hashcpy(result.sha, b->sha1);
                else if (sha_eq(b->sha1, o->sha1))
                        hashcpy(result.sha, a->sha1);
index f504cff7566159332c89f830a871da0ea05868fe..777f272668c39931b330be555f41399adfbce397 100644 (file)
@@ -454,6 +454,7 @@ static void write_pack_file(void)
        struct pack_header hdr;
        int do_progress = progress >> pack_to_stdout;
        uint32_t nr_remaining = nr_result;
+       time_t last_mtime = 0;
 
        if (do_progress)
                progress_state = start_progress("Writing objects", nr_result);
@@ -504,6 +505,7 @@ static void write_pack_file(void)
 
                if (!pack_to_stdout) {
                        mode_t mode = umask(0);
+                       struct stat st;
                        char *idx_tmp_name, tmpname[PATH_MAX];
 
                        umask(mode);
@@ -511,6 +513,7 @@ static void write_pack_file(void)
 
                        idx_tmp_name = write_idx_file(NULL, written_list,
                                                      nr_written, sha1);
+
                        snprintf(tmpname, sizeof(tmpname), "%s-%s.pack",
                                 base_name, sha1_to_hex(sha1));
                        if (adjust_perm(pack_tmp_name, mode))
@@ -519,6 +522,28 @@ static void write_pack_file(void)
                        if (rename(pack_tmp_name, tmpname))
                                die("unable to rename temporary pack file: %s",
                                    strerror(errno));
+
+                       /*
+                        * Packs are runtime accessed in their mtime
+                        * order since newer packs are more likely to contain
+                        * younger objects.  So if we are creating multiple
+                        * packs then we should modify the mtime of later ones
+                        * to preserve this property.
+                        */
+                       if (stat(tmpname, &st) < 0) {
+                               warning("failed to stat %s: %s",
+                                       tmpname, strerror(errno));
+                       } else if (!last_mtime) {
+                               last_mtime = st.st_mtime;
+                       } else {
+                               struct utimbuf utb;
+                               utb.actime = st.st_atime;
+                               utb.modtime = --last_mtime;
+                               if (utime(tmpname, &utb) < 0)
+                                       warning("failed utime() on %s: %s",
+                                               tmpname, strerror(errno));
+                       }
+
                        snprintf(tmpname, sizeof(tmpname), "%s-%s.idx",
                                 base_name, sha1_to_hex(sha1));
                        if (adjust_perm(idx_tmp_name, mode))
@@ -527,6 +552,7 @@ static void write_pack_file(void)
                        if (rename(idx_tmp_name, tmpname))
                                die("unable to rename temporary index file: %s",
                                    strerror(errno));
+
                        free(idx_tmp_name);
                        free(pack_tmp_name);
                        puts(sha1_to_hex(sha1));
index 160456dad13322e3547d6dc3fc91626bd3ec9c2b..e9cfd2bbc5539ee0c9c048798383b837ff63991b 100644 (file)
 #include "dir.h"
 #include "builtin.h"
 
-#define MAX_TREES 8
 static int nr_trees;
-static struct tree *trees[MAX_TREES];
+static struct tree *trees[MAX_UNPACK_TREES];
 
 static int list_tree(unsigned char *sha1)
 {
        struct tree *tree;
 
-       if (nr_trees >= MAX_TREES)
-               die("I cannot read more than %d trees", MAX_TREES);
+       if (nr_trees >= MAX_UNPACK_TREES)
+               die("I cannot read more than %d trees", MAX_UNPACK_TREES);
        tree = parse_tree_indirect(sha1);
        if (!tree)
                return -1;
@@ -97,7 +96,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
 {
        int i, newfd, stage = 0;
        unsigned char sha1[20];
-       struct tree_desc t[MAX_TREES];
+       struct tree_desc t[MAX_UNPACK_TREES];
        struct unpack_trees_options opts;
 
        memset(&opts, 0, sizeof(opts));
index b22b0edd65eefacabb648962b9c20c695609a3f5..bd795b1db7a4054a0218d1ec96794ad25d656896 100644 (file)
@@ -229,7 +229,9 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 {
        struct shortlog log;
        struct rev_info rev;
+       int nongit;
 
+       prefix = setup_git_directory_gently(&nongit);
        shortlog_init(&log);
 
        /* since -n is a shadowed rev argument, parse our args first */
@@ -259,7 +261,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
                die ("unrecognized argument: %s", argv[1]);
 
        /* assume HEAD if from a tty */
-       if (!rev.pending.nr && isatty(0))
+       if (!nongit && !rev.pending.nr && isatty(0))
                add_head_to_pending(&rev);
        if (rev.pending.nr == 0) {
                read_from_stdin(&log);
index a1e95914263355e2021f54be4837ed25f1210757..2f63bc8b2fac0d748e13d4435d550d61002092b3 100644 (file)
--- a/commit.h
+++ b/commit.h
@@ -70,7 +70,7 @@ extern void pretty_print_commit(enum cmit_fmt fmt, const struct commit*,
                                 struct strbuf *,
                                 int abbrev, const char *subject,
                                 const char *after_subject, enum date_mode,
-                               int non_ascii_present);
+                               int need_8bit_cte);
 void pp_user_info(const char *what, enum cmit_fmt fmt, struct strbuf *sb,
                   const char *line, enum date_mode dmode,
                   const char *encoding);
@@ -80,7 +80,7 @@ void pp_title_line(enum cmit_fmt fmt,
                   const char *subject,
                   const char *after_subject,
                   const char *encoding,
-                  int plain_non_ascii);
+                  int need_8bit_cte);
 void pp_remainder(enum cmit_fmt fmt,
                  const char **msg_p,
                  struct strbuf *sb,
index 8e1cd5f03de41ca929b6575ea8ed46e6bcfe2e7e..7868dfd93a8dab01927c3f5907733baf556e9b59 100644 (file)
@@ -46,4 +46,5 @@ NO_MKDTEMP=@NO_MKDTEMP@
 NO_ICONV=@NO_ICONV@
 OLD_ICONV=@OLD_ICONV@
 NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
+FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
 SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
index 287149d304b8a631d879bd3be7b059c6f074e5fe..82584e91532264790bac7efd953f9f5da09576c1 100644 (file)
@@ -327,6 +327,26 @@ else
 fi
 AC_SUBST(NO_C99_FORMAT)
 #
+# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
+# when attempting to read from an fopen'ed directory.
+AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],
+ [ac_cv_fread_reads_directories],
+[
+AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+               [[char c;
+               FILE *f = fopen(".", "r");
+               return f && fread(&c, 1, 1, f)]])],
+       [ac_cv_fread_reads_directories=no],
+       [ac_cv_fread_reads_directories=yes])
+])
+if test $ac_cv_fread_reads_directories = yes; then
+       FREAD_READS_DIRECTORIES=UnfortunatelyYes
+else
+       FREAD_READS_DIRECTORIES=
+fi
+AC_SUBST(FREAD_READS_DIRECTORIES)
+#
 # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
 # or vsnprintf() return -1 instead of number of characters which would
 # have been written to the final string if enough space had been available.
index 2838546d16073f29b3a87ce9126d92b0f640be5e..7959eab902d28bb3307c542514ca4c5f49deee0f 100755 (executable)
@@ -63,7 +63,7 @@ mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!"
 # create the links to the original repo.  explictly exclude index, HEAD and
 # logs/HEAD from the list since they are purely related to the current working
 # directory, and should not be shared.
-for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache
+for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn
 do
        case $x in
        */*)
index 73968e02b024f22068eb5500033f7a2f41d31e8f..a18235e6d053322a85805d1b07b631c6739deb93 100644 (file)
@@ -68,6 +68,7 @@
 #include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
+#include <utime.h>
 #ifndef NO_SYS_SELECT_H
 #include <sys/select.h>
 #endif
index 47f116f37ee1030ac0cab1f91feec04d673d94bd..95c5eec51ecc6ab6f142cef51eb4bd3b5842debb 100755 (executable)
@@ -735,7 +735,7 @@ sub commit {
                next unless $logmsg =~ $rx && $1;
                my $mparent = $1 eq 'HEAD' ? $opt_o : $1;
                if (my $sha1 = get_headref("$remote/$mparent")) {
-                       push @commit_args, '-p', $mparent;
+                       push @commit_args, '-p', "$remote/$mparent";
                        print "Merge parent branch: $mparent\n" if $opt_v;
                }
        }
index 233e5eae1d337bff40d0adba4bbb117bbd4b5dee..7cd8f7134e696312d243d73acebb6ecfe07d1e13 100755 (executable)
@@ -63,7 +63,23 @@ tmp_info="$tmp_dir/info"
 commit=$(git rev-parse HEAD)
 
 mkdir $tmp_dir || exit 2
-for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
+while read patch_name level garbage
+do
+       case "$patch_name" in ''|'#'*) continue;; esac
+       case "$level" in
+       -p*)    ;;
+       ''|'#'*)
+               level=;;
+       *)
+               echo "unable to parse patch level, ignoring it."
+               level=;;
+       esac
+       case "$garbage" in
+       ''|'#'*);;
+       *)
+               echo "trailing garbage found in series file: $garbage"
+               exit 1;;
+       esac
        if ! [ -f "$QUILT_PATCHES/$patch_name" ] ; then
                echo "$patch_name doesn't exist. Skipping."
                continue
@@ -113,10 +129,10 @@ for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
        fi
 
        if [ -z "$dry_run" ] ; then
-               git apply --index -C1 "$tmp_patch" &&
+               git apply --index -C1 ${level:+"$level"} "$tmp_patch" &&
                tree=$(git write-tree) &&
                commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit-tree $tree -p $commit) &&
                git update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4
        fi
-done
+done <"$QUILT_PATCHES/series"
 rm -rf $tmp_dir || exit 5
index d8b38c9a47c0b77dd55781a66e42e4dec26fd4b7..bba22c1321056f5daa58a6913ccc406850700b25 100755 (executable)
@@ -958,9 +958,10 @@ sub complete_url_ls_init {
                    "wanted to set to: $gs->{url}\n";
        }
        command_oneline('config', $k, $gs->{url}) unless $orig_url;
-       my $remote_path = "$ra->{svn_path}/$repo_path/*";
+       my $remote_path = "$ra->{svn_path}/$repo_path";
        $remote_path =~ s#/+#/#g;
        $remote_path =~ s#^/##g;
+       $remote_path .= "/*" if $remote_path !~ /\*/;
        my ($n) = ($switch =~ /^--(\w+)/);
        if (length $pfx && $pfx !~ m#/$#) {
                die "--prefix='$pfx' must have a trailing slash '/'\n";
index 1023b9085989aecfdcdc161232ee22de866d5f57..384148a59fc492d8fb1d6ea4fc4532aa1e5ffc22 100755 (executable)
@@ -23,12 +23,18 @@ USAGE='[--browser=browser|--tool=browser] [--config=conf.var] url/file ...'
 NONGIT_OK=Yes
 . git-sh-setup
 
+valid_custom_tool()
+{
+       browser_cmd="$(git config "browser.$1.cmd")"
+       test -n "$browser_cmd"
+}
+
 valid_tool() {
        case "$1" in
                firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open)
                        ;; # happy
                *)
-                       return 1
+                       valid_custom_tool "$1" || return 1
                        ;;
        esac
 }
@@ -122,7 +128,7 @@ else
 
     init_browser_path "$browser"
 
-    if ! type "$browser_path" > /dev/null 2>&1; then
+    if test -z "$browser_cmd" && ! type "$browser_path" > /dev/null 2>&1; then
        die "The browser $browser is not available as '$browser_path'."
     fi
 fi
@@ -157,4 +163,9 @@ case "$browser" in
     dillo)
        "$browser_path" "$@" &
        ;;
+    *)
+       if test -n "$browser_cmd"; then
+           ( eval $browser_cmd "$@" )
+       fi
+       ;;
 esac
diff --git a/git.c b/git.c
index 1e3eb1065fe3fe52361c2feaeadfab85780877ee..13de8018f0451c1e36d8fbc8f8c10233d2b45be9 100644 (file)
--- a/git.c
+++ b/git.c
@@ -343,7 +343,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
                { "rm", cmd_rm, RUN_SETUP },
                { "send-pack", cmd_send_pack, RUN_SETUP },
-               { "shortlog", cmd_shortlog, RUN_SETUP | USE_PAGER },
+               { "shortlog", cmd_shortlog, USE_PAGER },
                { "show-branch", cmd_show_branch, RUN_SETUP },
                { "show", cmd_show, RUN_SETUP | USE_PAGER },
                { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
index ae2b80b1083c18c6b0a15959fee304b6c43b3792..f90dfabffa894741f500e513d5380c7752d0195c 100644 (file)
@@ -8,6 +8,7 @@ gitk_libdir   ?= $(sharedir)/gitk/lib
 msgsdir    ?= $(gitk_libdir)/msgs
 msgsdir_SQ  = $(subst ','\'',$(msgsdir))
 
+TCL_PATH ?= tclsh
 TCLTK_PATH ?= wish
 INSTALL ?= install
 RM ?= rm -f
@@ -22,6 +23,9 @@ ifdef NO_MSGFMT
        MSGFMT ?= $(TCL_PATH) po/po2msg.sh
 else
        MSGFMT ?= msgfmt
+       ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
+               MSGFMT := $(TCL_PATH) po/po2msg.sh
+       endif
 endif
 
 PO_TEMPLATE = po/gitk.pot
index f1f21e97bf5e89bd7609cf5b6d1f417e35a43b6c..84ab02e15f6bdecdd04e8835e3aefd0875efea44 100644 (file)
@@ -82,7 +82,7 @@ proc dorunq {} {
 proc start_rev_list {view} {
     global startmsecs
     global commfd leftover tclencoding datemode
-    global viewargs viewfiles commitidx viewcomplete vnextroot
+    global viewargs viewargscmd viewfiles commitidx viewcomplete vnextroot
     global showlocalchanges commitinterest mainheadid
     global progressdirn progresscoords proglastnc curview
 
@@ -90,13 +90,23 @@ proc start_rev_list {view} {
     set commitidx($view) 0
     set viewcomplete($view) 0
     set vnextroot($view) 0
+    set args $viewargs($view)
+    if {$viewargscmd($view) ne {}} {
+       if {[catch {
+           set str [exec sh -c $viewargscmd($view)]
+       } err]} {
+           error_popup "Error executing --argscmd command: $err"
+           exit 1
+       }
+       set args [concat $args [split $str "\n"]]
+    }
     set order "--topo-order"
     if {$datemode} {
        set order "--date-order"
     }
     if {[catch {
        set fd [open [concat | git log --no-color -z --pretty=raw $order --parents \
-                        --boundary $viewargs($view) "--" $viewfiles($view)] r]
+                        --boundary $args "--" $viewfiles($view)] r]
     } err]} {
        error_popup "[mc "Error executing git rev-list:"] $err"
        exit 1
@@ -393,6 +403,9 @@ proc readcommit {id} {
 proc updatecommits {} {
     global viewdata curview phase displayorder ordertok idpending
     global children commitrow selectedline thickerline showneartags
+    global isworktree
+
+    set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
 
     if {$phase ne {}} {
        stop_rev_list
@@ -827,6 +840,7 @@ proc makewindow {} {
     }
     frame .bleft.top
     frame .bleft.mid
+    frame .bleft.bottom
 
     button .bleft.top.search -text [mc "Search"] -command dosearch
     pack .bleft.top.search -side left -padx 5
@@ -854,18 +868,25 @@ proc makewindow {} {
     checkbutton .bleft.mid.ignspace -text [mc "Ignore space change"] \
        -command changeignorespace -variable ignorespace
     pack .bleft.mid.ignspace -side left -padx 5
-    set ctext .bleft.ctext
+    set ctext .bleft.bottom.ctext
     text $ctext -background $bgcolor -foreground $fgcolor \
        -state disabled -font textfont \
-       -yscrollcommand scrolltext -wrap none
+       -yscrollcommand scrolltext -wrap none \
+       -xscrollcommand ".bleft.bottom.sbhorizontal set"
     if {$have_tk85} {
        $ctext conf -tabstyle wordprocessor
     }
-    scrollbar .bleft.sb -command "$ctext yview"
+    scrollbar .bleft.bottom.sb -command "$ctext yview"
+    scrollbar .bleft.bottom.sbhorizontal -command "$ctext xview" -orient h \
+       -width 10
     pack .bleft.top -side top -fill x
     pack .bleft.mid -side top -fill x
-    pack .bleft.sb -side right -fill y
-    pack $ctext -side left -fill both -expand 1
+    grid $ctext .bleft.bottom.sb -sticky nsew
+    grid .bleft.bottom.sbhorizontal -sticky ew
+    grid columnconfigure .bleft.bottom 0 -weight 1
+    grid rowconfigure .bleft.bottom 0 -weight 1
+    grid rowconfigure .bleft.bottom 1 -weight 0
+    pack .bleft.bottom -side top -fill both -expand 1
     lappend bglist $ctext
     lappend fglist $ctext
 
@@ -930,9 +951,17 @@ proc makewindow {} {
     .pwbottom add .bright
     .ctop add .pwbottom
 
-    # restore window position if known
+    # restore window width & height if known
     if {[info exists geometry(main)]} {
-        wm geometry . "$geometry(main)"
+       if {[scan $geometry(main) "%dx%d" w h] >= 2} {
+           if {$w > [winfo screenwidth .]} {
+               set w [winfo screenwidth .]
+           }
+           if {$h > [winfo screenheight .]} {
+               set h [winfo screenheight .]
+           }
+           wm geometry . "${w}x$h"
+       }
     }
 
     if {[tk windowingsystem] eq {aqua}} {
@@ -1160,9 +1189,10 @@ proc savestuff {w} {
     global canv canv2 canv3 mainfont textfont uifont tabstop
     global stuffsaved findmergefiles maxgraphpct
     global maxwidth showneartags showlocalchanges
-    global viewname viewfiles viewargs viewperm nextviewnum
+    global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
     global cmitmode wrapcomment datetimeformat limitdiffs
     global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
+    global autoselect
 
     if {$stuffsaved} return
     if {![winfo viewable .]} return
@@ -1177,6 +1207,7 @@ proc savestuff {w} {
        puts $f [list set maxwidth $maxwidth]
        puts $f [list set cmitmode $cmitmode]
        puts $f [list set wrapcomment $wrapcomment]
+       puts $f [list set autoselect $autoselect]
        puts $f [list set showneartags $showneartags]
        puts $f [list set showlocalchanges $showlocalchanges]
        puts $f [list set datetimeformat $datetimeformat]
@@ -1199,7 +1230,7 @@ proc savestuff {w} {
        puts -nonewline $f "set permviews {"
        for {set v 0} {$v < $nextviewnum} {incr v} {
            if {$viewperm($v)} {
-               puts $f "{[list $viewname($v) $viewfiles($v) $viewargs($v)]}"
+               puts $f "{[list $viewname($v) $viewfiles($v) $viewargs($v) $viewargscmd($v)]}"
            }
        }
        puts $f "}"
@@ -1850,7 +1881,7 @@ proc shellsplit {str} {
 
 proc newview {ishighlight} {
     global nextviewnum newviewname newviewperm newishighlight
-    global newviewargs revtreeargs
+    global newviewargs revtreeargs viewargscmd newviewargscmd curview
 
     set newishighlight $ishighlight
     set top .gitkview
@@ -1858,16 +1889,17 @@ proc newview {ishighlight} {
        raise $top
        return
     }
-    set newviewname($nextviewnum) "View $nextviewnum"
+    set newviewname($nextviewnum) "[mc "View"] $nextviewnum"
     set newviewperm($nextviewnum) 0
     set newviewargs($nextviewnum) [shellarglist $revtreeargs]
+    set newviewargscmd($nextviewnum) $viewargscmd($curview)
     vieweditor $top $nextviewnum [mc "Gitk view definition"]
 }
 
 proc editview {} {
     global curview
     global viewname viewperm newviewname newviewperm
-    global viewargs newviewargs
+    global viewargs newviewargs viewargscmd newviewargscmd
 
     set top .gitkvedit-$curview
     if {[winfo exists $top]} {
@@ -1877,6 +1909,7 @@ proc editview {} {
     set newviewname($curview) $viewname($curview)
     set newviewperm($curview) $viewperm($curview)
     set newviewargs($curview) [shellarglist $viewargs($curview)]
+    set newviewargscmd($curview) $viewargscmd($curview)
     vieweditor $top $curview "Gitk: edit view $viewname($curview)"
 }
 
@@ -1897,6 +1930,14 @@ proc vieweditor {top n title} {
     entry $top.args -width 50 -textvariable newviewargs($n) \
        -background $bgcolor
     grid $top.args - -sticky ew -padx 5
+
+    message $top.ac -aspect 1000 \
+       -text [mc "Command to generate more commits to include:"]
+    grid $top.ac - -sticky w -pady 5
+    entry $top.argscmd -width 50 -textvariable newviewargscmd($n) \
+       -background white
+    grid $top.argscmd - -sticky ew -padx 5
+
     message $top.l -aspect 1000 \
        -text [mc "Enter files and directories to include, one per line:"]
     grid $top.l - -sticky w
@@ -1940,7 +1981,7 @@ proc allviewmenus {n op args} {
 proc newviewok {top n} {
     global nextviewnum newviewperm newviewname newishighlight
     global viewname viewfiles viewperm selectedview curview
-    global viewargs newviewargs viewhlmenu
+    global viewargs newviewargs viewargscmd newviewargscmd viewhlmenu
 
     if {[catch {
        set newargs [shellsplit $newviewargs($n)]
@@ -1964,6 +2005,7 @@ proc newviewok {top n} {
        set viewperm($n) $newviewperm($n)
        set viewfiles($n) $files
        set viewargs($n) $newargs
+       set viewargscmd($n) $newviewargscmd($n)
        addviewmenu $n
        if {!$newishighlight} {
            run showview $n
@@ -1980,9 +2022,11 @@ proc newviewok {top n} {
            # doviewmenu $viewhlmenu 1 [list addvhighlight $n] \
                # entryconf [list -label $viewname($n) -value $viewname($n)]
        }
-       if {$files ne $viewfiles($n) || $newargs ne $viewargs($n)} {
+       if {$files ne $viewfiles($n) || $newargs ne $viewargs($n) || \
+               $newviewargscmd($n) ne $viewargscmd($n)} {
            set viewfiles($n) $files
            set viewargs($n) $newargs
+           set viewargscmd($n) $newviewargscmd($n)
            if {$curview == $n} {
                run updatecommits
            }
@@ -2058,8 +2102,6 @@ proc showview {n} {
        set ybot [expr {[lindex $span 1] * $ymax}]
        if {$ytop < $y && $y < $ybot} {
            set yscreen [expr {$y - $ytop}]
-       } else {
-           set yscreen [expr {($ybot - $ytop) / 2}]
        }
     } elseif {[info exists pending_select]} {
        set selid $pending_select
@@ -2120,7 +2162,7 @@ proc showview {n} {
     set yf 0
     set row {}
     set selectfirst 0
-    if {$selid ne {} && [info exists commitrow($n,$selid)]} {
+    if {[info exists yscreen] && [info exists commitrow($n,$selid)]} {
        set row $commitrow($n,$selid)
        # try to get the selected row in the same position on the screen
        set ymax [lindex [$canv cget -scrollregion] 3]
@@ -2844,8 +2886,9 @@ proc dohidelocalchanges {} {
 # spawn off a process to do git diff-index --cached HEAD
 proc dodiffindex {} {
     global localirow localfrow lserial showlocalchanges
+    global isworktree
 
-    if {!$showlocalchanges} return
+    if {!$showlocalchanges || !$isworktree} return
     incr lserial
     set localfrow -1
     set localirow -1
@@ -4650,6 +4693,7 @@ proc selectline {l isnew} {
     global commentend idtags linknum
     global mergemax numcommits pending_select
     global cmitmode showneartags allcommits
+    global autoselect
 
     catch {unset pending_select}
     $canv delete hover
@@ -4705,8 +4749,10 @@ proc selectline {l isnew} {
     set currentid $id
     $sha1entry delete 0 end
     $sha1entry insert 0 $id
-    $sha1entry selection from 0
-    $sha1entry selection to end
+    if {$autoselect} {
+       $sha1entry selection from 0
+       $sha1entry selection to end
+    }
     rhighlight_sel $id
 
     $ctext conf -state normal
@@ -5604,7 +5650,7 @@ proc searchmarkvisible {doall} {
 proc scrolltext {f0 f1} {
     global searchstring
 
-    .bleft.sb set $f0 $f1
+    .bleft.bottom.sb set $f0 $f1
     if {$searchstring ne {}} {
        searchmarkvisible 0
     }
@@ -7943,7 +7989,7 @@ proc doprefs {} {
     global maxwidth maxgraphpct
     global oldprefs prefstop showneartags showlocalchanges
     global bgcolor fgcolor ctext diffcolors selectbgcolor
-    global tabstop limitdiffs
+    global tabstop limitdiffs autoselect
 
     set top .gitkprefs
     set prefstop $top
@@ -7973,6 +8019,11 @@ proc doprefs {} {
     checkbutton $top.showlocal.b -variable showlocalchanges
     pack $top.showlocal.b $top.showlocal.l -side left
     grid x $top.showlocal -sticky w
+    frame $top.autoselect
+    label $top.autoselect.l -text [mc "Auto-select SHA1"] -font optionfont
+    checkbutton $top.autoselect.b -variable autoselect
+    pack $top.autoselect.b $top.autoselect.l -side left
+    grid x $top.autoselect -sticky w
 
     label $top.ddisp -text [mc "Diff display options"]
     grid $top.ddisp - -sticky w -pady 10
@@ -8463,6 +8514,7 @@ set maxlinelen 200
 set showlocalchanges 1
 set limitdiffs 1
 set datetimeformat "%Y-%m-%d %H:%M:%S"
+set autoselect 1
 
 set colors {green red blue magenta darkgrey brown orange}
 set bgcolor white
@@ -8522,8 +8574,9 @@ set mergeonly 0
 set revtreeargs {}
 set cmdline_files {}
 set i 0
+set revtreeargscmd {}
 foreach arg $argv {
-    switch -- $arg {
+    switch -glob -- $arg {
        "" { }
        "-d" { set datemode 1 }
        "--merge" {
@@ -8534,6 +8587,9 @@ foreach arg $argv {
            set cmdline_files [lrange $argv [expr {$i + 1}] end]
            break
        }
+       "--argscmd=*" {
+           set revtreeargscmd [string range $arg 10 end]
+       }
        default {
            lappend revtreeargs $arg
        }
@@ -8635,6 +8691,7 @@ set highlight_files {}
 set viewfiles(0) {}
 set viewperm(0) 0
 set viewargs(0) {}
+set viewargscmd(0) {}
 
 set cmdlineok 0
 set stopped 0
@@ -8643,6 +8700,7 @@ set patchnum 0
 set localirow -1
 set localfrow -1
 set lserial 0
+set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
 setcoords
 makewindow
 # wait for the window to become visible
@@ -8650,7 +8708,7 @@ tkwait visibility .
 wm title . "[file tail $argv0]: [file tail [pwd]]"
 readrefs
 
-if {$cmdline_files ne {} || $revtreeargs ne {}} {
+if {$cmdline_files ne {} || $revtreeargs ne {} || $revtreeargscmd ne {}} {
     # create a view for the files/dirs specified on the command line
     set curview 1
     set selectedview 1
@@ -8658,6 +8716,7 @@ if {$cmdline_files ne {} || $revtreeargs ne {}} {
     set viewname(1) [mc "Command line"]
     set viewfiles(1) $cmdline_files
     set viewargs(1) $revtreeargs
+    set viewargscmd(1) $revtreeargscmd
     set viewperm(1) 0
     addviewmenu 1
     .bar.view entryconf [mc "Edit view..."] -state normal
@@ -8671,6 +8730,7 @@ if {[info exists permviews]} {
        set viewname($n) [lindex $v 0]
        set viewfiles($n) [lindex $v 1]
        set viewargs($n) [lindex $v 2]
+       set viewargscmd($n) [lindex $v 3]
        set viewperm($n) 1
        addviewmenu $n
     }
diff --git a/gitk-git/po/it.po b/gitk-git/po/it.po
new file mode 100644 (file)
index 0000000..d0f4c2e
--- /dev/null
@@ -0,0 +1,890 @@
+# Translation of gitk
+# Copyright (C) 2005-2008 Paul Mackerras
+# This file is distributed under the same license as the gitk package.
+# Michele Ballabio <barra_cuda@katamail.com>, 2008.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gitk\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-03-13 17:29+0100\n"
+"PO-Revision-Date: 2008-03-13 17:34+0100\n"
+"Last-Translator: Michele Ballabio <barra_cuda@katamail.com>\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: gitk:111
+msgid "Error executing git rev-list:"
+msgstr "Errore nell'esecuzione di git rev-list:"
+
+#: gitk:124
+msgid "Reading"
+msgstr "Lettura in corso"
+
+#: gitk:151 gitk:2191
+msgid "Reading commits..."
+msgstr "Lettura delle revisioni in corso..."
+
+#: gitk:275
+msgid "Can't parse git log output:"
+msgstr "Impossibile elaborare i dati di git log:"
+
+#: gitk:386 gitk:2195
+msgid "No commits selected"
+msgstr "Nessuna revisione selezionata"
+
+#: gitk:500
+msgid "No commit information available"
+msgstr "Nessuna informazione disponibile sulle revisioni"
+
+#: gitk:599 gitk:621 gitk:1955 gitk:6423 gitk:7923 gitk:8082
+msgid "OK"
+msgstr "OK"
+
+#: gitk:623 gitk:1956 gitk:6107 gitk:6178 gitk:6275 gitk:6321 gitk:6425
+#: gitk:7924 gitk:8083
+msgid "Cancel"
+msgstr "Annulla"
+
+#: gitk:661
+msgid "File"
+msgstr "File"
+
+#: gitk:663
+msgid "Update"
+msgstr "Aggiorna"
+
+#: gitk:664
+msgid "Reread references"
+msgstr "Rileggi riferimenti"
+
+#: gitk:665
+msgid "List references"
+msgstr "Elenca riferimenti"
+
+#: gitk:666
+msgid "Quit"
+msgstr "Esci"
+
+#: gitk:668
+msgid "Edit"
+msgstr "Modifica"
+
+#: gitk:669
+msgid "Preferences"
+msgstr "Preferenze"
+
+#: gitk:672 gitk:1892
+msgid "View"
+msgstr "Vista"
+
+#: gitk:673
+msgid "New view..."
+msgstr "Nuova vista..."
+
+#: gitk:674 gitk:2133 gitk:8722
+msgid "Edit view..."
+msgstr "Modifica vista..."
+
+#: gitk:676 gitk:2134 gitk:8723
+msgid "Delete view"
+msgstr "Elimina vista"
+
+#: gitk:678
+msgid "All files"
+msgstr "Tutti i file"
+
+#: gitk:682
+msgid "Help"
+msgstr "Aiuto"
+
+#: gitk:683 gitk:1317
+msgid "About gitk"
+msgstr "Informazioni su gitk"
+
+#: gitk:684
+msgid "Key bindings"
+msgstr "Scorciatoie da tastiera"
+
+#: gitk:741
+msgid "SHA1 ID: "
+msgstr "SHA1 ID: "
+
+#: gitk:791
+msgid "Find"
+msgstr "Trova"
+
+#: gitk:792
+msgid "next"
+msgstr "succ"
+
+#: gitk:793
+msgid "prev"
+msgstr "prec"
+
+#: gitk:794
+msgid "commit"
+msgstr "revisione"
+
+#: gitk:797 gitk:799 gitk:2356 gitk:2379 gitk:2403 gitk:4306 gitk:4369
+msgid "containing:"
+msgstr "contenente:"
+
+#: gitk:800 gitk:1778 gitk:1783 gitk:2431
+msgid "touching paths:"
+msgstr "che riguarda i percorsi:"
+
+#: gitk:801 gitk:2436
+msgid "adding/removing string:"
+msgstr "che aggiunge/rimuove la stringa:"
+
+#: gitk:810 gitk:812
+msgid "Exact"
+msgstr "Esatto"
+
+#: gitk:812 gitk:2514 gitk:4274
+msgid "IgnCase"
+msgstr ""
+
+#: gitk:812 gitk:2405 gitk:2512 gitk:4270
+msgid "Regexp"
+msgstr ""
+
+#: gitk:814 gitk:815 gitk:2533 gitk:2563 gitk:2570 gitk:4380 gitk:4436
+msgid "All fields"
+msgstr "Tutti i campi"
+
+#: gitk:815 gitk:2531 gitk:2563 gitk:4336
+msgid "Headline"
+msgstr "Titolo"
+
+#: gitk:816 gitk:2531 gitk:4336 gitk:4436 gitk:4827
+msgid "Comments"
+msgstr "Commenti"
+
+#: gitk:816 gitk:2531 gitk:2535 gitk:2570 gitk:4336 gitk:4763 gitk:5956
+#: gitk:5971
+msgid "Author"
+msgstr "Autore"
+
+#: gitk:816 gitk:2531 gitk:4336 gitk:4765
+msgid "Committer"
+msgstr "Revisione creata da"
+
+#: gitk:845
+msgid "Search"
+msgstr "Cerca"
+
+#: gitk:852
+msgid "Diff"
+msgstr ""
+
+#: gitk:854
+msgid "Old version"
+msgstr "Vecchia versione"
+
+#: gitk:856
+msgid "New version"
+msgstr "Nuova versione"
+
+#: gitk:858
+msgid "Lines of context"
+msgstr "Linee di contesto"
+
+#: gitk:868
+msgid "Ignore space change"
+msgstr "Ignora modifiche agli spazi"
+
+#: gitk:926
+msgid "Patch"
+msgstr "Modifiche"
+
+#: gitk:928
+msgid "Tree"
+msgstr "Directory"
+
+#: gitk:1053 gitk:1068 gitk:6022
+msgid "Diff this -> selected"
+msgstr "Diff questo -> selezionato"
+
+#: gitk:1055 gitk:1070 gitk:6023
+msgid "Diff selected -> this"
+msgstr "Diff selezionato -> questo"
+
+#: gitk:1057 gitk:1072 gitk:6024
+msgid "Make patch"
+msgstr "Crea patch"
+
+#: gitk:1058 gitk:6162
+msgid "Create tag"
+msgstr "Crea etichetta"
+
+#: gitk:1059 gitk:6255
+msgid "Write commit to file"
+msgstr "Scrivi revisione in un file"
+
+#: gitk:1060 gitk:6309
+msgid "Create new branch"
+msgstr "Crea un nuovo ramo"
+
+#: gitk:1061
+msgid "Cherry-pick this commit"
+msgstr "Porta questa revisione in cima al ramo attuale"
+
+#: gitk:1063
+msgid "Reset HEAD branch to here"
+msgstr "Aggiorna il ramo HEAD a questa revisione"
+
+#: gitk:1079
+msgid "Check out this branch"
+msgstr "Attiva questo ramo"
+
+#: gitk:1081
+msgid "Remove this branch"
+msgstr "Elimina questo ramo"
+
+#: gitk:1087
+msgid "Highlight this too"
+msgstr "Evidenzia anche questo"
+
+#: gitk:1089
+msgid "Highlight this only"
+msgstr "Evidenzia solo questo"
+
+#: gitk:1318
+msgid ""
+"\n"
+"Gitk - a commit viewer for git\n"
+"\n"
+"Copyright © 2005-2006 Paul Mackerras\n"
+"\n"
+"Use and redistribute under the terms of the GNU General Public License"
+msgstr ""
+"\n"
+"Gitk - un visualizzatore di revisioni per git\n"
+"\n"
+"Copyright © 2005-2006 Paul Mackerras\n"
+"\n"
+"Utilizzo e redistribuzione permessi sotto i termini della GNU General Public "
+"License"
+
+#: gitk:1326 gitk:1387 gitk:6581
+msgid "Close"
+msgstr "Chiudi"
+
+#: gitk:1345
+msgid "Gitk key bindings"
+msgstr "Scorciatoie da tastiera di Gitk"
+
+#: gitk:1347
+msgid "Gitk key bindings:"
+msgstr "Scorciatoie da tastiera di Gitk:"
+
+#: gitk:1349
+#, tcl-format
+msgid "<%s-Q>\t\tQuit"
+msgstr "<%s-Q>\t\tEsci"
+
+#: gitk:1350
+msgid "<Home>\t\tMove to first commit"
+msgstr "<Home>\t\tVai alla prima revisione"
+
+#: gitk:1351
+msgid "<End>\t\tMove to last commit"
+msgstr "<End>\t\tVai all'ultima revisione"
+
+#: gitk:1352
+msgid "<Up>, p, i\tMove up one commit"
+msgstr "<Up>, p, i\tVai più in alto di una revisione"
+
+#: gitk:1353
+msgid "<Down>, n, k\tMove down one commit"
+msgstr "<Down>, n, k\tVai più in basso di una revisione"
+
+#: gitk:1354
+msgid "<Left>, z, j\tGo back in history list"
+msgstr "<Left>, z, j\tTorna indietro nella cronologia"
+
+#: gitk:1355
+msgid "<Right>, x, l\tGo forward in history list"
+msgstr "<Right>, x, l\tVai avanti nella cronologia"
+
+#: gitk:1356
+msgid "<PageUp>\tMove up one page in commit list"
+msgstr "<PageUp>\tVai più in alto di una pagina nella lista delle revisioni"
+
+#: gitk:1357
+msgid "<PageDown>\tMove down one page in commit list"
+msgstr "<PageDown>\tVai più in basso di una pagina nella lista delle revisioni"
+
+#: gitk:1358
+#, tcl-format
+msgid "<%s-Home>\tScroll to top of commit list"
+msgstr "<%s-Home>\tScorri alla cima della lista delle revisioni"
+
+#: gitk:1359
+#, tcl-format
+msgid "<%s-End>\tScroll to bottom of commit list"
+msgstr "<%s-End>\tScorri alla fine della lista delle revisioni"
+
+#: gitk:1360
+#, tcl-format
+msgid "<%s-Up>\tScroll commit list up one line"
+msgstr "<%s-Up>\tScorri la lista delle revisioni in alto di una riga"
+
+#: gitk:1361
+#, tcl-format
+msgid "<%s-Down>\tScroll commit list down one line"
+msgstr "<%s-Down>\tScorri la lista delle revisioni in basso di una riga"
+
+#: gitk:1362
+#, tcl-format
+msgid "<%s-PageUp>\tScroll commit list up one page"
+msgstr "<%s-PageUp>\tScorri la lista delle revisioni in alto di una pagina"
+
+#: gitk:1363
+#, tcl-format
+msgid "<%s-PageDown>\tScroll commit list down one page"
+msgstr "<%s-PageDown>\tScorri la lista delle revisioni in basso di una pagina"
+
+#: gitk:1364
+msgid "<Shift-Up>\tFind backwards (upwards, later commits)"
+msgstr "<Shift-Up>\tTrova all'indietro (verso l'alto, revisioni successive)"
+
+#: gitk:1365
+msgid "<Shift-Down>\tFind forwards (downwards, earlier commits)"
+msgstr "<Shift-Down>\tTrova in avanti (verso il basso, revisioni precedenti)"
+
+#: gitk:1366
+msgid "<Delete>, b\tScroll diff view up one page"
+msgstr "<Delete>, b\tScorri la vista delle differenze in alto di una pagina"
+
+#: gitk:1367
+msgid "<Backspace>\tScroll diff view up one page"
+msgstr "<Backspace>\tScorri la vista delle differenze in alto di una pagina"
+
+#: gitk:1368
+msgid "<Space>\t\tScroll diff view down one page"
+msgstr "<Space>\t\tScorri la vista delle differenze in basso di una pagina"
+
+#: gitk:1369
+msgid "u\t\tScroll diff view up 18 lines"
+msgstr "u\t\tScorri la vista delle differenze in alto di 18 linee"
+
+#: gitk:1370
+msgid "d\t\tScroll diff view down 18 lines"
+msgstr "d\t\tScorri la vista delle differenze in basso di 18 linee"
+
+#: gitk:1371
+#, tcl-format
+msgid "<%s-F>\t\tFind"
+msgstr "<%s-F>\t\tTrova"
+
+#: gitk:1372
+#, tcl-format
+msgid "<%s-G>\t\tMove to next find hit"
+msgstr "<%s-G>\t\tTrova in avanti"
+
+#: gitk:1373
+msgid "<Return>\tMove to next find hit"
+msgstr "<Return>\tTrova in avanti"
+
+#: gitk:1374
+msgid "/\t\tMove to next find hit, or redo find"
+msgstr "/\t\tTrova in avanti, o cerca di nuovo"
+
+#: gitk:1375
+msgid "?\t\tMove to previous find hit"
+msgstr "?\t\tTrova all'indietro"
+
+#: gitk:1376
+msgid "f\t\tScroll diff view to next file"
+msgstr "f\t\tScorri la vista delle differenze al file successivo"
+
+#: gitk:1377
+#, tcl-format
+msgid "<%s-S>\t\tSearch for next hit in diff view"
+msgstr "<%s-S>\t\tCerca in avanti nella vista delle differenze"
+
+#: gitk:1378
+#, tcl-format
+msgid "<%s-R>\t\tSearch for previous hit in diff view"
+msgstr "<%s-R>\t\tCerca all'indietro nella vista delle differenze"
+
+#: gitk:1379
+#, tcl-format
+msgid "<%s-KP+>\tIncrease font size"
+msgstr "<%s-KP+>\tAumenta grandezza carattere"
+
+#: gitk:1380
+#, tcl-format
+msgid "<%s-plus>\tIncrease font size"
+msgstr "<%s-plus>\tAumenta grandezza carattere"
+
+#: gitk:1381
+#, tcl-format
+msgid "<%s-KP->\tDecrease font size"
+msgstr "<%s-KP->\tDiminuisci grandezza carattere"
+
+#: gitk:1382
+#, tcl-format
+msgid "<%s-minus>\tDecrease font size"
+msgstr "<%s-minus>\tDiminuisci grandezza carattere"
+
+#: gitk:1383
+msgid "<F5>\t\tUpdate"
+msgstr "<F5>\t\tAggiorna"
+
+#: gitk:1896
+msgid "Gitk view definition"
+msgstr "Scelta vista Gitk"
+
+#: gitk:1921
+msgid "Name"
+msgstr "Nome"
+
+#: gitk:1924
+msgid "Remember this view"
+msgstr "Ricorda questa vista"
+
+#: gitk:1928
+msgid "Commits to include (arguments to git rev-list):"
+msgstr "Revisioni da includere (argomenti di git rev-list):"
+
+#: gitk:1935
+msgid "Command to generate more commits to include:"
+msgstr "Comando che genera altre revisioni da visualizzare:"
+
+#: gitk:1942
+msgid "Enter files and directories to include, one per line:"
+msgstr "Inserire file e directory da includere, uno per riga:"
+
+#: gitk:1989
+msgid "Error in commit selection arguments:"
+msgstr "Errore negli argomenti di selezione delle revisioni:"
+
+#: gitk:2043 gitk:2127 gitk:2583 gitk:2597 gitk:3781 gitk:8688 gitk:8689
+msgid "None"
+msgstr "Nessuno"
+
+#: gitk:2531 gitk:4336 gitk:5958 gitk:5973
+msgid "Date"
+msgstr "Data"
+
+#: gitk:2531 gitk:4336
+msgid "CDate"
+msgstr ""
+
+#: gitk:2680 gitk:2685
+msgid "Descendant"
+msgstr "Discendente"
+
+#: gitk:2681
+msgid "Not descendant"
+msgstr "Non discendente"
+
+#: gitk:2688 gitk:2693
+msgid "Ancestor"
+msgstr "Ascendente"
+
+#: gitk:2689
+msgid "Not ancestor"
+msgstr "Non ascendente"
+
+#: gitk:2924
+msgid "Local changes checked in to index but not committed"
+msgstr "Modifiche locali presenti nell'indice ma non nell'archivio"
+
+#: gitk:2954
+msgid "Local uncommitted changes, not checked in to index"
+msgstr "Modifiche locali non presenti né nell'archivio né nell'indice"
+
+#: gitk:4305
+msgid "Searching"
+msgstr "Ricerca in corso"
+
+#: gitk:4767
+msgid "Tags:"
+msgstr "Etichette:"
+
+#: gitk:4784 gitk:4790 gitk:5951
+msgid "Parent"
+msgstr "Genitore"
+
+#: gitk:4795
+msgid "Child"
+msgstr "Figlio"
+
+#: gitk:4804
+msgid "Branch"
+msgstr "Ramo"
+
+#: gitk:4807
+msgid "Follows"
+msgstr "Segue"
+
+#: gitk:4810
+msgid "Precedes"
+msgstr "Precede"
+
+#: gitk:5093
+msgid "Error getting merge diffs:"
+msgstr "Errore nella lettura delle differenze di fusione:"
+
+#: gitk:5778
+msgid "Goto:"
+msgstr "Vai a:"
+
+#: gitk:5780
+msgid "SHA1 ID:"
+msgstr "SHA1 ID:"
+
+#: gitk:5805
+#, tcl-format
+msgid "Short SHA1 id %s is ambiguous"
+msgstr "La SHA1 id abbreviata %s è ambigua"
+
+#: gitk:5817
+#, tcl-format
+msgid "SHA1 id %s is not known"
+msgstr "La SHA1 id %s è sconosciuta"
+
+#: gitk:5819
+#, tcl-format
+msgid "Tag/Head %s is not known"
+msgstr "L'etichetta/ramo %s è sconosciuto"
+
+#: gitk:5961
+msgid "Children"
+msgstr "Figli"
+
+#: gitk:6018
+#, tcl-format
+msgid "Reset %s branch to here"
+msgstr "Aggiorna il ramo %s a questa revisione"
+
+#: gitk:6049
+msgid "Top"
+msgstr "Inizio"
+
+#: gitk:6050
+msgid "From"
+msgstr "Da"
+
+#: gitk:6055
+msgid "To"
+msgstr "A"
+
+#: gitk:6078
+msgid "Generate patch"
+msgstr "Genera patch"
+
+#: gitk:6080
+msgid "From:"
+msgstr "Da:"
+
+#: gitk:6089
+msgid "To:"
+msgstr "A:"
+
+#: gitk:6098
+msgid "Reverse"
+msgstr "Inverti"
+
+#: gitk:6100 gitk:6269
+msgid "Output file:"
+msgstr "Scrivi sul file:"
+
+#: gitk:6106
+msgid "Generate"
+msgstr "Genera"
+
+#: gitk:6142
+msgid "Error creating patch:"
+msgstr "Errore nella creazione della patch:"
+
+#: gitk:6164 gitk:6257 gitk:6311
+msgid "ID:"
+msgstr "ID:"
+
+#: gitk:6173
+msgid "Tag name:"
+msgstr "Nome etichetta:"
+
+#: gitk:6177 gitk:6320
+msgid "Create"
+msgstr "Crea"
+
+#: gitk:6192
+msgid "No tag name specified"
+msgstr "Nessuna etichetta specificata"
+
+#: gitk:6196
+#, tcl-format
+msgid "Tag \"%s\" already exists"
+msgstr "L'etichetta \"%s\" esiste già"
+
+#: gitk:6202
+msgid "Error creating tag:"
+msgstr "Errore nella creazione dell'etichetta:"
+
+#: gitk:6266
+msgid "Command:"
+msgstr "Comando:"
+
+#: gitk:6274
+msgid "Write"
+msgstr "Scrivi"
+
+#: gitk:6290
+msgid "Error writing commit:"
+msgstr "Errore nella scrittura della revisione:"
+
+#: gitk:6316
+msgid "Name:"
+msgstr "Nome:"
+
+#: gitk:6335
+msgid "Please specify a name for the new branch"
+msgstr "Specificare un nome per il nuovo ramo"
+
+#: gitk:6364
+#, tcl-format
+msgid "Commit %s is already included in branch %s -- really re-apply it?"
+msgstr "La revisione %s è già inclusa nel ramo %s -- applicarla di nuovo?"
+
+#: gitk:6369
+msgid "Cherry-picking"
+msgstr ""
+
+#: gitk:6381
+msgid "No changes committed"
+msgstr "Nessuna modifica archiviata"
+
+#: gitk:6404
+msgid "Confirm reset"
+msgstr "Conferma git reset"
+
+#: gitk:6406
+#, tcl-format
+msgid "Reset branch %s to %s?"
+msgstr "Aggiornare il ramo %s a %s?"
+
+#: gitk:6410
+msgid "Reset type:"
+msgstr "Tipo di aggiornamento:"
+
+#: gitk:6414
+msgid "Soft: Leave working tree and index untouched"
+msgstr "Soft: Lascia la direcory di lavoro e l'indice come sono"
+
+#: gitk:6417
+msgid "Mixed: Leave working tree untouched, reset index"
+msgstr "Mixed: Lascia la directory di lavoro come è, aggiorna l'indice"
+
+#: gitk:6420
+msgid ""
+"Hard: Reset working tree and index\n"
+"(discard ALL local changes)"
+msgstr ""
+"Hard: Aggiorna la directory di lavoro e l'indice\n"
+"(abbandona TUTTE le modifiche locali)"
+
+#: gitk:6436
+msgid "Resetting"
+msgstr "git reset in corso"
+
+#: gitk:6493
+msgid "Checking out"
+msgstr "Attivazione in corso"
+
+#: gitk:6523
+msgid "Cannot delete the currently checked-out branch"
+msgstr "Impossibile cancellare il ramo attualmente attivo"
+
+#: gitk:6529
+#, tcl-format
+msgid ""
+"The commits on branch %s aren't on any other branch.\n"
+"Really delete branch %s?"
+msgstr ""
+"Le revisioni nel ramo %s non sono presenti su altri rami.\n"
+"Cancellare il ramo %s?"
+
+#: gitk:6560
+#, tcl-format
+msgid "Tags and heads: %s"
+msgstr "Etichette e rami: %s"
+
+#: gitk:6574
+msgid "Filter"
+msgstr "Filtro"
+
+#: gitk:6868
+msgid ""
+"Error reading commit topology information; branch and preceding/following "
+"tag information will be incomplete."
+msgstr ""
+"Errore nella lettura della topologia delle revisioni: le informazioni sul "
+"ramo e le etichette precedenti e seguenti saranno incomplete."
+
+#: gitk:7852
+msgid "Tag"
+msgstr "Etichetta"
+
+#: gitk:7852
+msgid "Id"
+msgstr "Id"
+
+#: gitk:7892
+msgid "Gitk font chooser"
+msgstr "Scelta caratteri gitk"
+
+#: gitk:7909
+msgid "B"
+msgstr "B"
+
+#: gitk:7912
+msgid "I"
+msgstr "I"
+
+#: gitk:8005
+msgid "Gitk preferences"
+msgstr "Preferenze gitk"
+
+#: gitk:8006
+msgid "Commit list display options"
+msgstr "Opzioni visualizzazione dell'elenco revisioni"
+
+#: gitk:8009
+msgid "Maximum graph width (lines)"
+msgstr "Larghezza massima del grafico (in linee)"
+
+#: gitk:8013
+#, tcl-format
+msgid "Maximum graph width (% of pane)"
+msgstr "Larghezza massima del grafico (% del pannello)"
+
+#: gitk:8018
+msgid "Show local changes"
+msgstr "Mostra modifiche locali"
+
+#: gitk:8023
+msgid "Auto-select SHA1"
+msgstr "Seleziona automaticamente SHA1 hash"
+
+#: gitk:8028
+msgid "Diff display options"
+msgstr "Opzioni di visualizzazione delle differenze"
+
+#: gitk:8030
+msgid "Tab spacing"
+msgstr "Spaziatura tabulazioni"
+
+#: gitk:8034
+msgid "Display nearby tags"
+msgstr "Mostra etichette vicine"
+
+#: gitk:8039
+msgid "Limit diffs to listed paths"
+msgstr "Limita le differenze ai percorsi elencati"
+
+#: gitk:8044
+msgid "Colors: press to choose"
+msgstr "Colori: premere per scegliere"
+
+#: gitk:8047
+msgid "Background"
+msgstr "Sfondo"
+
+#: gitk:8051
+msgid "Foreground"
+msgstr "Primo piano"
+
+#: gitk:8055
+msgid "Diff: old lines"
+msgstr "Diff: vecchie linee"
+
+#: gitk:8060
+msgid "Diff: new lines"
+msgstr "Diff: nuove linee"
+
+#: gitk:8065
+msgid "Diff: hunk header"
+msgstr "Diff: intestazione della sezione"
+
+#: gitk:8071
+msgid "Select bg"
+msgstr "Sfondo selezione"
+
+#: gitk:8075
+msgid "Fonts: press to choose"
+msgstr "Carattere: premere per scegliere"
+
+#: gitk:8077
+msgid "Main font"
+msgstr "Carattere principale"
+
+#: gitk:8078
+msgid "Diff display font"
+msgstr "Carattere per differenze"
+
+#: gitk:8079
+msgid "User interface font"
+msgstr "Carattere per interfaccia utente"
+
+#: gitk:8095
+#, tcl-format
+msgid "Gitk: choose color for %s"
+msgstr "Gitk: scegliere un colore per %s"
+
+#: gitk:8476
+msgid ""
+"Sorry, gitk cannot run with this version of Tcl/Tk.\n"
+" Gitk requires at least Tcl/Tk 8.4."
+msgstr ""
+"Questa versione di Tcl/Tk non può avviare gitk.\n"
+" Gitk richiede Tcl/Tk versione 8.4 o superiore."
+
+#: gitk:8565
+msgid "Cannot find a git repository here."
+msgstr "Archivio git non trovato."
+
+#: gitk:8569
+#, tcl-format
+msgid "Cannot find the git directory \"%s\"."
+msgstr "Directory git \"%s\" non trovata."
+
+#: gitk:8612
+#, tcl-format
+msgid "Ambiguous argument '%s': both revision and filename"
+msgstr "Argomento ambiguo: '%s' è sia revisione che nome di file"
+
+#: gitk:8624
+msgid "Bad arguments to gitk:"
+msgstr "Gitk: argomenti errati:"
+
+#: gitk:8636
+msgid "Couldn't get list of unmerged files:"
+msgstr "Impossibile ottenere l'elenco dei file in attesa di fusione:"
+
+#: gitk:8652
+msgid "No files selected: --merge specified but no files are unmerged."
+msgstr ""
+"Nessun file selezionato: è stata specificata l'opzione --merge ma non ci "
+"sono file in attesa di fusione."
+
+#: gitk:8655
+msgid ""
+"No files selected: --merge specified but no unmerged files are within file "
+"limit."
+msgstr ""
+"Nessun file selezionato: è stata specificata l'opzione --merge ma i file "
+"specificati non sono in attesa di fusione."
+
+#: gitk:8716
+msgid "Command line"
+msgstr "Linea di comando"
index 608f697cf3860245510bff907a643d9b6143e724..5b2963998cc497177d913b6224799531d45dbb4a 100644 (file)
@@ -138,10 +138,14 @@ static int has_non_ascii(const char *s)
 }
 
 void log_write_email_headers(struct rev_info *opt, const char *name,
-                            const char **subject_p, const char **extra_headers_p)
+                            const char **subject_p,
+                            const char **extra_headers_p,
+                            int *need_8bit_cte_p)
 {
        const char *subject = NULL;
        const char *extra_headers = opt->extra_headers;
+
+       *need_8bit_cte_p = 0; /* unknown */
        if (opt->total > 0) {
                static char buffer[64];
                snprintf(buffer, sizeof(buffer),
@@ -169,6 +173,7 @@ void log_write_email_headers(struct rev_info *opt, const char *name,
        if (opt->mime_boundary) {
                static char subject_buffer[1024];
                static char buffer[1024];
+               *need_8bit_cte_p = -1; /* NEVER */
                snprintf(subject_buffer, sizeof(subject_buffer) - 1,
                         "%s"
                         "MIME-Version: 1.0\n"
@@ -212,6 +217,7 @@ void show_log(struct rev_info *opt, const char *sep)
        int abbrev_commit = opt->abbrev_commit ? opt->abbrev : 40;
        const char *extra;
        const char *subject = NULL, *extra_headers = opt->extra_headers;
+       int need_8bit_cte = 0;
 
        opt->loginfo = NULL;
        if (!opt->verbose_header) {
@@ -255,7 +261,8 @@ void show_log(struct rev_info *opt, const char *sep)
 
        if (opt->commit_format == CMIT_FMT_EMAIL) {
                log_write_email_headers(opt, sha1_to_hex(commit->object.sha1),
-                                       &subject, &extra_headers);
+                                       &subject, &extra_headers,
+                                       &need_8bit_cte);
        } else if (opt->commit_format != CMIT_FMT_USERFORMAT) {
                fputs(diff_get_color_opt(&opt->diffopt, DIFF_COMMIT), stdout);
                if (opt->commit_format != CMIT_FMT_ONELINE)
@@ -299,9 +306,11 @@ void show_log(struct rev_info *opt, const char *sep)
         * And then the pretty-printed message itself
         */
        strbuf_init(&msgbuf, 0);
+       if (need_8bit_cte >= 0)
+               need_8bit_cte = has_non_ascii(opt->add_signoff);
        pretty_print_commit(opt->commit_format, commit, &msgbuf,
                            abbrev, subject, extra_headers, opt->date_mode,
-                           has_non_ascii(opt->add_signoff));
+                           need_8bit_cte);
 
        if (opt->add_signoff)
                append_signoff(&msgbuf, opt->add_signoff);
index 0cc9344eabdd0046edf360958376b2037ef643dc..8946ff377ca455dd1c4efaa609ce9af382005836 100644 (file)
@@ -14,6 +14,8 @@ int log_tree_opt_parse(struct rev_info *, const char **, int);
 void show_log(struct rev_info *opt, const char *sep);
 void show_decorations(struct commit *commit);
 void log_write_email_headers(struct rev_info *opt, const char *name,
-                            const char **subject_p, const char **extra_headers_p);
+                            const char **subject_p,
+                            const char **extra_headers_p,
+                            int *need_8bit_cte_p);
 
 #endif
index 703f52176bf0b5cbf52cf1f77ba55ba6d87fac94..16bfb86cd3ce6d6b471cdc313114563ca78837dc 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -636,7 +636,7 @@ void pp_title_line(enum cmit_fmt fmt,
                   const char *subject,
                   const char *after_subject,
                   const char *encoding,
-                  int plain_non_ascii)
+                  int need_8bit_cte)
 {
        struct strbuf title;
 
@@ -669,7 +669,7 @@ void pp_title_line(enum cmit_fmt fmt,
        }
        strbuf_addch(sb, '\n');
 
-       if (plain_non_ascii) {
+       if (need_8bit_cte > 0) {
                const char *header_fmt =
                        "MIME-Version: 1.0\n"
                        "Content-Type: text/plain; charset=%s\n"
@@ -718,9 +718,9 @@ void pp_remainder(enum cmit_fmt fmt,
 }
 
 void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
-                                 struct strbuf *sb, int abbrev,
-                                 const char *subject, const char *after_subject,
-                                 enum date_mode dmode, int plain_non_ascii)
+                        struct strbuf *sb, int abbrev,
+                        const char *subject, const char *after_subject,
+                        enum date_mode dmode, int need_8bit_cte)
 {
        unsigned long beginning_of_body;
        int indent = 4;
@@ -746,13 +746,11 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
        if (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL)
                indent = 0;
 
-       /* After-subject is used to pass in Content-Type: multipart
-        * MIME header; in that case we do not have to do the
-        * plaintext content type even if the commit message has
-        * non 7-bit ASCII character.  Otherwise, check if we need
-        * to say this is not a 7-bit ASCII.
+       /*
+        * We need to check and emit Content-type: to mark it
+        * as 8-bit if we haven't done so.
         */
-       if (fmt == CMIT_FMT_EMAIL && !after_subject) {
+       if (fmt == CMIT_FMT_EMAIL && need_8bit_cte == 0) {
                int i, ch, in_body;
 
                for (in_body = i = 0; (ch = msg[i]); i++) {
@@ -765,7 +763,7 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
                                        in_body = 1;
                        }
                        else if (non_ascii(ch)) {
-                               plain_non_ascii = 1;
+                               need_8bit_cte = 1;
                                break;
                        }
                }
@@ -790,7 +788,7 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
        /* These formats treat the title line specially. */
        if (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL)
                pp_title_line(fmt, &msg, sb, subject,
-                             after_subject, encoding, plain_non_ascii);
+                             after_subject, encoding, need_8bit_cte);
 
        beginning_of_body = sb->len;
        if (fmt != CMIT_FMT_ONELINE)
index 8b6c76f68ed1433caddfa8aab6132db667197433..491d2e7ebf19d5c582adbc5ece28d931b09b8a6d 100644 (file)
@@ -407,18 +407,22 @@ static int get_nth_ancestor(const char *name, int len,
                            unsigned char *result, int generation)
 {
        unsigned char sha1[20];
-       int ret = get_sha1_1(name, len, sha1);
+       struct commit *commit;
+       int ret;
+
+       ret = get_sha1_1(name, len, sha1);
        if (ret)
                return ret;
+       commit = lookup_commit_reference(sha1);
+       if (!commit)
+               return -1;
 
        while (generation--) {
-               struct commit *commit = lookup_commit_reference(sha1);
-
-               if (!commit || parse_commit(commit) || !commit->parents)
+               if (parse_commit(commit) || !commit->parents)
                        return -1;
-               hashcpy(sha1, commit->parents->item->object.sha1);
+               commit = commit->parents->item;
        }
-       hashcpy(result, sha1);
+       hashcpy(result, commit->object.sha1);
        return 0;
 }
 
@@ -544,9 +548,8 @@ static int get_sha1_1(const char *name, int len, unsigned char *sha1)
        int ret, has_suffix;
        const char *cp;
 
-       /* "name~3" is "name^^^",
-        * "name~" and "name~0" are name -- not "name^0"!
-        * "name^" is not "name^0"; it is "name^1".
+       /*
+        * "name~3" is "name^^^", "name~" is "name~1", and "name^" is "name^1".
         */
        has_suffix = 0;
        for (cp = name + len - 1; name <= cp; cp--) {
@@ -564,11 +567,10 @@ static int get_sha1_1(const char *name, int len, unsigned char *sha1)
                cp++;
                while (cp < name + len)
                        num = num * 10 + *cp++ - '0';
-               if (has_suffix == '^') {
-                       if (!num && len1 == len - 1)
-                               num = 1;
+               if (!num && len1 == len - 1)
+                       num = 1;
+               if (has_suffix == '^')
                        return get_parent(name, len1, sha1, num);
-               }
                /* else if (has_suffix == '~') -- goes without saying */
                return get_nth_ancestor(name, len1, sha1, num);
        }
index 24476bede5ce8f8720bf3d9eba7f7a944182dbf4..73f830db2374e751fb46e25b345e860979b9dd05 100755 (executable)
@@ -202,22 +202,4 @@ test_expect_success 'delete' '
 
 '
 
-test_expect_success 'prune --expire' '
-
-       before=$(git count-objects | sed "s/ .*//") &&
-       BLOB=$(echo aleph | git hash-object -w --stdin) &&
-       BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
-       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
-       test -f $BLOB_FILE &&
-       git reset --hard &&
-       git prune --expire=1.hour.ago &&
-       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
-       test -f $BLOB_FILE &&
-       test-chmtime -86500 $BLOB_FILE &&
-       git prune --expire 1.day &&
-       test $before = $(git count-objects | sed "s/ .*//") &&
-       ! test -f $BLOB_FILE
-
-'
-
 test_done
index 67a70fadabbdcaca15832c86d76f1e194a923a75..ba43f185494630c50fc2a168df8dcd45c0b2421b 100755 (executable)
@@ -32,11 +32,19 @@ test_expect_success 'format with signoff without funny signer name' '
 
 test_expect_success 'format with non ASCII signer name' '
 
-       GIT_COMMITTER_NAME="\e$B$O$^$N\e(B \e$B$U$K$*$&\e(B" \
+       GIT_COMMITTER_NAME="はまの ふにおう" \
        git format-patch -s --stdout -1 >output &&
        grep Content-Type output
 
 '
 
+test_expect_success 'attach and signoff do not duplicate mime headers' '
+
+       GIT_COMMITTER_NAME="はまの ふにおう" \
+       git format-patch -s --stdout -1 --attach >output &&
+       test `grep -ci ^MIME-Version: output` = 1
+
+'
+
 test_done
 
diff --git a/t/t4028-format-patch-mime-headers.sh b/t/t4028-format-patch-mime-headers.sh
new file mode 100755 (executable)
index 0000000..204ba67
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='format-patch mime headers and extra headers do not conflict'
+. ./test-lib.sh
+
+test_expect_success 'create commit with utf-8 body' '
+       echo content >file &&
+       git add file &&
+       git commit -m one &&
+       echo more >>file &&
+       git commit -a -m "two
+
+       utf-8 body: ñ"
+'
+
+test_expect_success 'patch has mime headers' '
+       rm -f 0001-two.patch &&
+       git format-patch HEAD^ &&
+       grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch
+'
+
+test_expect_success 'patch has mime and extra headers' '
+       rm -f 0001-two.patch &&
+       git config format.headers "x-foo: bar" &&
+       git format-patch HEAD^ &&
+       grep -i "x-foo: bar" 0001-two.patch &&
+       grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch
+'
+
+test_done
index 6d12efb74d8bedede8e476429b2fccd648eb05a3..eef4cafda99729977af9bee2eca83493814faede 100755 (executable)
@@ -47,4 +47,9 @@ EOF
 
 test_expect_success 'shortlog wrapping' 'diff -u expect out'
 
+git log HEAD > log
+GIT_DIR=non-existing git shortlog -w < log > out
+
+test_expect_success 'shortlog from non-git directory' 'diff -u expect out'
+
 test_done
index 6560af756e7b4df0c7777e818edc86854f74b973..47090c4cf528016bf864116232baf29aeb1e4bfe 100644 (file)
@@ -29,4 +29,53 @@ test_expect_success 'prune stale packs' '
 
 '
 
+test_expect_success 'prune --expire' '
+
+       before=$(git count-objects | sed "s/ .*//") &&
+       BLOB=$(echo aleph | git hash-object -w --stdin) &&
+       BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
+       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+       test -f $BLOB_FILE &&
+       git prune --expire=1.hour.ago &&
+       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+       test -f $BLOB_FILE &&
+       test-chmtime -86500 $BLOB_FILE &&
+       git prune --expire 1.day &&
+       test $before = $(git count-objects | sed "s/ .*//") &&
+       ! test -f $BLOB_FILE
+
+'
+
+test_expect_success 'gc: implicit prune --expire' '
+
+       before=$(git count-objects | sed "s/ .*//") &&
+       BLOB=$(echo aleph_0 | git hash-object -w --stdin) &&
+       BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
+       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+       test -f $BLOB_FILE &&
+       test-chmtime -$((86400*14-30)) $BLOB_FILE &&
+       git gc &&
+       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+       test -f $BLOB_FILE &&
+       test-chmtime -$((86400*14+1)) $BLOB_FILE &&
+       git gc &&
+       test $before = $(git count-objects | sed "s/ .*//") &&
+       ! test -f $BLOB_FILE
+
+'
+
+test_expect_success 'gc: refuse to start with invalid gc.pruneExpire' '
+
+       git config gc.pruneExpire invalid &&
+       test_must_fail git gc
+
+'
+
+test_expect_success 'gc: start with ok gc.pruneExpire' '
+
+       git config gc.pruneExpire 2.days.ago &&
+       git gc
+
+'
+
 test_done
diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh
new file mode 100755 (executable)
index 0000000..5bb6b93
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+test_description='merge-recursive: handle file mode'
+. ./test-lib.sh
+
+test_expect_success 'mode change in one branch: keep changed version' '
+       : >file1 &&
+       git add file1 &&
+       git commit -m initial &&
+       git checkout -b a1 master &&
+       : >dummy &&
+       git add dummy &&
+       git commit -m a &&
+       git checkout -b b1 master &&
+       chmod +x file1 &&
+       git add file1 &&
+       git commit -m b1 &&
+       git checkout a1 &&
+       git merge-recursive master -- a1 b1 &&
+       test -x file1
+'
+
+test_expect_success 'mode change in both branches: expect conflict' '
+       git reset --hard HEAD &&
+       git checkout -b a2 master &&
+       : >file2 &&
+       H=$(git hash-object file2) &&
+       chmod +x file2 &&
+       git add file2 &&
+       git commit -m a2 &&
+       git checkout -b b2 master &&
+       : >file2 &&
+       git add file2 &&
+       git commit -m b2 &&
+       git checkout a2 &&
+       (
+               git merge-recursive master -- a2 b2
+               test $? = 1
+       ) &&
+       git ls-files -u >actual &&
+       (
+               echo "100755 $H 2       file2"
+               echo "100644 $H 3       file2"
+       ) >expect &&
+       diff -u actual expect &&
+       test -x file2
+'
+
+test_done
index be89d52e8c55d71fe7dff2e7e2f6d6d5f8a7ca16..93019abdc1192fbb4649573ad507205b26652109 100644 (file)
@@ -123,7 +123,7 @@ static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_option
 int traverse_trees_recursive(int n, unsigned long dirmask, unsigned long df_conflicts, struct name_entry *names, struct traverse_info *info)
 {
        int i;
-       struct tree_desc t[3];
+       struct tree_desc t[MAX_UNPACK_TREES];
        struct traverse_info newinfo;
        struct name_entry *p;
 
@@ -327,8 +327,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
 {
        static struct cache_entry *dfc;
 
-       if (len > 4)
-               die("unpack_trees takes at most four trees");
+       if (len > MAX_UNPACK_TREES)
+               die("unpack_trees takes at most %d trees", MAX_UNPACK_TREES);
        memset(&state, 0, sizeof(state));
        state.base_dir = "";
        state.force = 1;
@@ -336,6 +336,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
        state.refresh_cache = 1;
 
        memset(&o->result, 0, sizeof(o->result));
+       if (o->src_index)
+               o->result.timestamp = o->src_index->timestamp;
        o->merge_size = len;
 
        if (!dfc)
index e8abbcd037167a58c816d94f4f0c617d6572d23d..50453ed20f755fea2e7138d7f01300b318f28dce 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef UNPACK_TREES_H
 #define UNPACK_TREES_H
 
+#define MAX_UNPACK_TREES 8
+
 struct unpack_trees_options;
 
 typedef int (*merge_fn_t)(struct cache_entry **src,
index bba236428adb0b34421b9f1b5a3a1728911ee406..61dc5c547019776b971dc89d009f628bbac134fd 100644 (file)
@@ -152,8 +152,8 @@ int read_mmfile(mmfile_t *ptr, const char *filename)
        if ((f = fopen(filename, "rb")) == NULL)
                return error("Could not open %s", filename);
        sz = xsize_t(st.st_size);
-       ptr->ptr = xmalloc(sz);
-       if (fread(ptr->ptr, sz, 1, f) != 1)
+       ptr->ptr = xmalloc(sz ? sz : 1);
+       if (sz && fread(ptr->ptr, sz, 1, f) != 1)
                return error("Could not read %s", filename);
        fclose(f);
        ptr->size = sz;