Merge branch 'om/remote-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 13 Jun 2008 05:55:44 +0000 (22:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Jun 2008 05:55:44 +0000 (22:55 -0700)
* om/remote-fix:
"remote prune": be quiet when there is nothing to prune
remote show: list tracked remote branches with -n
remote prune: print the list of pruned branches
builtin-remote: split show_or_prune() in two separate functions
remote show: fix the -n option

15 files changed:
Documentation/.gitignore
Documentation/RelNotes-1.5.6.txt
Documentation/cat-texi.perl
Documentation/git-cat-file.txt
Documentation/git-pull.txt
Documentation/gittutorial.txt
Documentation/pretty-formats.txt
Documentation/user-manual.txt
builtin-fast-export.c
git-cvsimport.perl
git-submodule.sh
gitk-git/gitk
sha1_file.c
t/.gitattributes
t/test-lib.sh
index 2f938f471a647f387355290695d54433def16e46..d8edd904065fbc4bd06365ce378f57d4cd8f9f0d 100644 (file)
@@ -2,7 +2,9 @@
 *.html
 *.[1-8]
 *.made
+*.texi
 git.info
+gitman.info
 howto-index.txt
 doc.dep
 cmds-*.txt
index a79e4b93935a7e0aff1b72495b0ee5947df73c0a..ac4881e19a155f7cbb661ed715f969df63189664 100644 (file)
@@ -70,7 +70,7 @@ Updates since v1.5.5
 
 * "git init --bare" is a synonym for "git --bare init" now.
 
-* "git gc --auto" honors a new pre-aut-gc hook to temporarily disable it.
+* "git gc --auto" honors a new pre-auto-gc hook to temporarily disable it.
 
 * "git log --pretty=tformat:<custom format>" gives a LF after each entry,
   instead of giving a LF between each pair of entries which is how
index e3d8e9faa8c4b64c757080b89f304f78d30fbc17..dbc133cd3c1f19dd507014477e68b8ada78eab5e 100755 (executable)
@@ -11,7 +11,7 @@
        if (s/^\@top (.*)/\@node $1,,,Top/) {
                push @menu, $1;
        }
-       s/\(\@pxref{\[URLS\]}\)//;
+       s/\(\@pxref{\[(URLS|REMOTES)\]}\)//;
        print TMP;
 }
 close TMP;
index 3f77dbd107e8dba3eadcb7698d91627f28f7fe1e..f58013ca605631437e5a4806cdd07dba18d8a982 100644 (file)
@@ -8,6 +8,7 @@ git-cat-file - Provide content or type/size information for repository objects
 
 SYNOPSIS
 --------
+[verse]
 'git-cat-file' [-t | -s | -e | -p | <type>] <object>
 'git-cat-file' [--batch | --batch-check] < <list-of-objects>
 
index 5f55f6494a1a66daf8ba77d8a1f709ca9dc55103..d0f1595f7e9051b5d58d1dba030ea3a7d80bdab5 100644 (file)
@@ -38,7 +38,8 @@ include::merge-options.txt[]
        for branch `<name>`, set configuration `branch.<name>.rebase`
        to `true`.
 +
-*NOTE:* This is a potentially _dangerous_ mode of operation.
+[NOTE]
+This is a potentially _dangerous_ mode of operation.
 It rewrites history, which does not bode well when you
 published that history already.  Do *not* use this option
 unless you have read linkgit:git-rebase[1] carefully.
index 9563a632eb5fef5fe62a5b5bd152cd06ad874a1f..d465aab64e367f1564793b74522d571433d5b53f 100644 (file)
@@ -114,7 +114,7 @@ newly modified content to the index.  Finally, commit your changes with:
 $ git commit
 ------------------------------------------------
 
-This will again prompt your for a message describing the change, and then
+This will again prompt you for a message describing the change, and then
 record a new version of the project.
 
 Alternatively, instead of running `git add` beforehand, you can use
index e8bea3e18e569e702233d0bb986fc7e52266d445..ec3755579408ebae58c7de644609590f5636b9c6 100644 (file)
@@ -124,3 +124,25 @@ The placeholders are:
 - '%m': left, right or boundary mark
 - '%n': newline
 - '%x00': print a byte from a hex code
+
+* 'tformat:'
++
+The 'tformat:' format works exactly like 'format:', except that it
+provides "terminator" semantics instead of "separator" semantics. In
+other words, each commit has the message terminator character (usually a
+newline) appended, rather than a separator placed between entries.
+This means that the final entry of a single-line format will be properly
+terminated with a new line, just as the "oneline" format does.
+For example:
++
+---------------------
+$ git log -2 --pretty=format:%h 4da45bef \
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
+4da45be
+7134973 -- NO NEWLINE
+
+$ git log -2 --pretty=tformat:%h 4da45bef \
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
+4da45be
+7134973
+---------------------
index bfde507e0ec9a5aadf71bfb42470b8669369ad56..64a820bf60ae5da8aaaac5fd72c169b8dd381c89 100644 (file)
@@ -1254,16 +1254,15 @@ these three "file stages" represents a different version of the file:
 
 -------------------------------------------------
 $ git show :1:file.txt # the file in a common ancestor of both branches
-$ git show :2:file.txt # the version from HEAD, but including any
-                       # nonconflicting changes from MERGE_HEAD
-$ git show :3:file.txt # the version from MERGE_HEAD, but including any
-                       # nonconflicting changes from HEAD.
+$ git show :2:file.txt # the version from HEAD.
+$ git show :3:file.txt # the version from MERGE_HEAD.
 -------------------------------------------------
 
-Since the stage 2 and stage 3 versions have already been updated with
-nonconflicting changes, the only remaining differences between them are
-the important ones; thus linkgit:git-diff[1] can use the information in
-the index to show only those conflicts.
+When you ask linkgit:git-diff[1] to show the conflicts, it runs a
+three-way diff between the conflicted merge results in the work tree with
+stages 2 and 3 to show only hunks whose contents come from both sides,
+mixed (in other words, when a hunk's merge results come only from stage 2,
+that part is not conflicting and is not shown.  Same for stage 3).
 
 The diff above shows the differences between the working-tree version of
 file.txt and the stage 2 and stage 3 versions.  So instead of preceding
index 1dfc01e8f009968ef5d6118bffed7818e736576c..d0a462ff8b3760a4a21d9a72339a02891a5b4aef 100644 (file)
@@ -188,6 +188,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
        mark_object(&commit->object);
        if (!is_encoding_utf8(encoding))
                reencoded = reencode_string(message, "UTF-8", encoding);
+       if (!commit->parents)
+               printf("reset %s\n", (const char*)commit->util);
        printf("commit %s\nmark :%d\n%.*s\n%.*s\ndata %u\n%s",
               (const char *)commit->util, last_idnum,
               (int)(author_end - author), author,
index 5a0255052c9360fdc4cbbdd79008a206ab3e4623..cacbfc0259fd1ae353117d93e345cd8c4dd41188 100755 (executable)
@@ -227,6 +227,7 @@ sub conn {
                                $proxyport = $1;
                        }
                }
+               $repo ||= '/';
 
                # if username is not explicit in CVSROOT, then use current user, as cvs would
                $user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
index 100737210de3c76682ab3803626a36328fb27ca1..403283090775141d884aa248ceb6c629e57912bb 100755 (executable)
@@ -73,7 +73,7 @@ resolve_relative_url ()
 module_name()
 {
        # Do we have "submodule.<something>.path = $1" defined in .gitmodules file?
-       re=$(printf '%s' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
+       re=$(printf '%s\n' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
        name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
                sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
        test -z "$name" &&
index 22bcd18a4671b3bdd78f065c65bdaf042ba4a77e..fddcb45817ed6839ba95965d7e57e9a2e04ae30a 100644 (file)
@@ -296,7 +296,7 @@ proc start_rev_list {view} {
     global startmsecs commitidx viewcomplete curview
     global commfd leftover tclencoding
     global viewargs viewargscmd viewfiles vfilelimit
-    global showlocalchanges commitinterest mainheadid
+    global showlocalchanges commitinterest
     global viewactive loginstance viewinstances vmergeonly
     global pending_select mainheadid
     global vcanopt vflags vrevs vorigargs
@@ -358,7 +358,7 @@ proc start_rev_list {view} {
     set viewinstances($view) [list $i]
     set commfd($i) $fd
     set leftover($i) {}
-    if {$showlocalchanges} {
+    if {$showlocalchanges && $mainheadid ne {}} {
        lappend commitinterest($mainheadid) {dodiffindex}
     }
     fconfigure $fd -blocking 0 -translation lf -eofchar {}
@@ -406,7 +406,7 @@ proc getcommits {} {
 
 proc updatecommits {} {
     global curview vcanopt vorigargs vfilelimit viewinstances
-    global viewactive viewcomplete loginstance tclencoding mainheadid
+    global viewactive viewcomplete loginstance tclencoding
     global startmsecs commfd showneartags showlocalchanges leftover
     global mainheadid pending_select
     global isworktree
@@ -1467,7 +1467,6 @@ proc chewcommits {} {
     if {$viewcomplete($curview)} {
        global commitidx varctok
        global numcommits startmsecs
-       global mainheadid nullid
 
        if {[info exists pending_select]} {
            set row [first_real_row]
@@ -1604,12 +1603,10 @@ proc readrefs {} {
     set mainhead {}
     set mainheadid {}
     catch {
+       set mainheadid [exec git rev-parse HEAD]
        set thehead [exec git symbolic-ref HEAD]
        if {[string match "refs/heads/*" $thehead]} {
            set mainhead [string range $thehead 11 end]
-           if {[info exists headids($mainhead)]} {
-               set mainheadid $headids($mainhead)
-           }
        }
     }
 }
@@ -4022,6 +4019,7 @@ proc layoutmore {} {
 proc doshowlocalchanges {} {
     global curview mainheadid
 
+    if {$mainheadid eq {}} return
     if {[commitinview $mainheadid $curview]} {
        dodiffindex
     } else {
@@ -4841,7 +4839,8 @@ proc drawcmittext {id row col} {
     global cmitlisted commitinfo rowidlist parentlist
     global rowtextx idpos idtags idheads idotherrefs
     global linehtag linentag linedtag selectedline
-    global canvxmax boldrows boldnamerows fgcolor nullid nullid2
+    global canvxmax boldrows boldnamerows fgcolor
+    global mainheadid nullid nullid2 circleitem circlecolors
 
     # listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right
     set listed $cmitlisted($curview,$id)
@@ -4849,8 +4848,10 @@ proc drawcmittext {id row col} {
        set ofill red
     } elseif {$id eq $nullid2} {
        set ofill green
+    } elseif {$id eq $mainheadid} {
+       set ofill yellow
     } else {
-       set ofill [expr {$listed != 0 ? $listed == 2 ? "gray" : "blue" : "white"}]
+       set ofill [lindex $circlecolors $listed]
     }
     set x [xc $row $col]
     set y [yc $row]
@@ -4874,6 +4875,7 @@ proc drawcmittext {id row col} {
                   [expr {$x - $orad}] [expr {$y + $orad - 1}] \
                   -fill $ofill -outline $fgcolor -width 1 -tags circle]
     }
+    set circleitem($row) $t
     $canv raise $t
     $canv bind $t <1> {selcanvline {} %x %y}
     set rmx [llength [lindex $rowidlist $row]]
@@ -7399,12 +7401,18 @@ proc domktag {} {
 }
 
 proc redrawtags {id} {
-    global canv linehtag idpos currentid curview
-    global canvxmax iddrawn
+    global canv linehtag idpos currentid curview cmitlisted
+    global canvxmax iddrawn circleitem mainheadid circlecolors
 
     if {![commitinview $id $curview]} return
     if {![info exists iddrawn($id)]} return
     set row [rowofcommit $id]
+    if {$id eq $mainheadid} {
+       set ofill yellow
+    } else {
+       set ofill [lindex $circlecolors $cmitlisted($curview,$id)]
+    }
+    $canv itemconf $circleitem($row) -fill $ofill
     $canv delete tag.$id
     set xt [eval drawtags $id $idpos($id)]
     $canv coords $linehtag($row) $xt [lindex $idpos($id) 2]
@@ -7574,8 +7582,8 @@ proc cherrypick {} {
        if {$mainhead ne {}} {
            movehead $newhead $mainhead
            movedhead $newhead $mainhead
-           set mainheadid $newhead
        }
+       set mainheadid $newhead
        redrawtags $oldhead
        redrawtags $newhead
        selbyid $newhead
@@ -7675,7 +7683,7 @@ proc headmenu {x y id head} {
 }
 
 proc cobranch {} {
-    global headmenuid headmenuhead mainhead headids
+    global headmenuid headmenuhead headids
     global showlocalchanges mainheadid
 
     # check the tree is clean first??
@@ -7711,12 +7719,10 @@ proc readcheckoutstat {fd newhead newheadid} {
     if {[catch {close $fd} err]} {
        error_popup $err
     }
-    set oldmainhead $mainhead
+    set oldmainid $mainheadid
     set mainhead $newhead
     set mainheadid $newheadid
-    if {[info exists headids($oldmainhead)]} {
-       redrawtags $headids($oldmainhead)
-    }
+    redrawtags $oldmainid
     redrawtags $newheadid
     selbyid $newheadid
     if {$showlocalchanges} {
@@ -9016,12 +9022,14 @@ proc rereadrefs {} {
                        [array names idheads] [array names idotherrefs]]]
     foreach id $refids {
        set v [listrefs $id]
-       if {![info exists ref($id)] || $ref($id) != $v ||
-           ($id eq $oldmainhead && $id ne $mainheadid) ||
-           ($id eq $mainheadid && $id ne $oldmainhead)} {
+       if {![info exists ref($id)] || $ref($id) != $v} {
            redrawtags $id
        }
     }
+    if {$oldmainhead ne $mainheadid} {
+       redrawtags $oldmainhead
+       redrawtags $mainheadid
+    }
     run refill_reflist
 }
 
@@ -9761,6 +9769,8 @@ set diffcontext 3
 set ignorespace 0
 set selectbgcolor gray85
 
+set circlecolors {white blue gray blue blue}
+
 ## For msgcat loading, first locate the installation location.
 if { [info exists ::env(GITK_MSGSDIR)] } {
     ## Msgsdir was manually set in the environment.
index adcf37c3f68d16200b01adae441fa3d8f68e3c02..f311c79e50bce4cf39cd1c2c51f63974517a2f5c 100644 (file)
@@ -2105,6 +2105,15 @@ int hash_sha1_file(const void *buf, unsigned long len, const char *type,
        return 0;
 }
 
+/* Finalize a file on disk, and close it. */
+static void close_sha1_file(int fd)
+{
+       /* For safe-mode, we could fsync_or_die(fd, "sha1 file") here */
+       fchmod(fd, 0444);
+       if (close(fd) != 0)
+               die("unable to write sha1 file");
+}
+
 static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
                              void *buf, unsigned long len, time_t mtime)
 {
@@ -2170,9 +2179,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
 
        if (write_buffer(fd, compressed, size) < 0)
                die("unable to write sha1 file");
-       fchmod(fd, 0444);
-       if (close(fd))
-               die("unable to write sha1 file");
+       close_sha1_file(fd);
        free(compressed);
 
        if (mtime) {
@@ -2350,9 +2357,7 @@ int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
        } while (1);
        inflateEnd(&stream);
 
-       fchmod(local, 0444);
-       if (close(local) != 0)
-               die("unable to write sha1 file");
+       close_sha1_file(local);
        SHA1_Final(real_sha1, &c);
        if (ret != Z_STREAM_END) {
                unlink(tmpfile);
index 562b12e16ebc543db80629d8bcf9499f7a16e74f..ab6edbf19e80a5e07c85ff7cde05061fba349647 100644 (file)
@@ -1 +1,2 @@
-* -whitespace
+t[0-9][0-9][0-9][0-9]-*.sh -whitespace
+t[0-9][0-9][0-9][0-9]/* -whitespace
index 7a8bd27abc79a43a9248c3bcee8d6a3670e30fe3..e9c9081edf9609a9273d8a471a909bac62f380e8 100644 (file)
@@ -168,7 +168,7 @@ trap 'die' exit
 # environment variables to work around this.
 #
 # In particular, quoting isn't enough, as the path may contain the same quote
-# that we're using. 
+# that we're using.
 test_set_editor () {
        FAKE_EDITOR="$1"
        export FAKE_EDITOR