Merge branch 'master' of git://repo.or.cz/alt-git

This commit is contained in:
Johannes Sixt
2009-09-28 08:39:57 +02:00
9 changed files with 706 additions and 318 deletions

View File

@@ -32,7 +32,7 @@ Updates since v1.6.4
(subsystems)
* various updates to git-svn and gitweb.
* various updates to gitk, git-svn and gitweb.
(portability)
@@ -41,12 +41,14 @@ Updates since v1.6.4
* mingw will also give FRSX as the default value for the LESS
environment variable when the user does not have one.
* initial support to compile git on Windows with MSVC.
(performance)
* On major platforms, the system can be compiled to use with Linus's
block-sha1 implementation of the SHA-1 hash algorithm, which
outperforms the default fallback implementation we borrowed from
Mozzilla.
Mozilla.
* Unnecessary inefficiency in deepening of a shallow repository has
been removed.
@@ -84,12 +86,21 @@ Updates since v1.6.4
* "git am" learned "--scissors" option to allow you to discard early part
of an incoming e-mail.
* "git archive -o output.zip" works without being told what format to
use with an explicit "--format=zip".option.
* "git checkout", "git reset" and "git stash" learned to pick and
choose to use selected changes you made, similar to "git add -p".
* "git clone" learned a "-b" option to pick a HEAD to check out
different from the remote's default branch.
* "git clone" learned --recursive option.
* "git clone" from a local repository on a different filesystem used to
copy individual object files without preserving the old timestamp, giving
them extra lifetime in the new repository until they gc'ed.
* "git commit --dry-run $args" is a new recommended way to ask "what would
happen if I try to commit with these arguments."
@@ -155,7 +166,6 @@ Fixes since v1.6.4
--
exec >/var/tmp/1
O=v1.6.4.2-298-gdf01e7c
O=v1.6.5-rc0-49-g5f2b1e6
O=v1.6.5-rc1-44-ga16753d
echo O=$(git describe master)
git shortlog --no-merges $O..master --not maint

View File

@@ -81,7 +81,7 @@ couple of magic command line options:
+
---------------------------------------------
$ git describe -h
usage: git-describe [options] <committish>*
usage: git describe [options] <committish>*
--contains find the tag that comes after the commit
--debug debug search strategy on stderr

View File

@@ -620,8 +620,8 @@ __git_aliased_command ()
done
}
# __git_find_subcommand requires 1 argument
__git_find_subcommand ()
# __git_find_on_cmdline requires 1 argument
__git_find_on_cmdline ()
{
local word subcommand c=1
@@ -740,7 +740,7 @@ _git_bisect ()
__git_has_doubledash && return
local subcommands="start bad good skip reset visualize replay log run"
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
@@ -1749,7 +1749,7 @@ _git_config ()
_git_remote ()
{
local subcommands="add rename rm show prune update set-head"
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
@@ -1780,7 +1780,7 @@ _git_reset ()
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "--merge --mixed --hard --soft"
__gitcomp "--merge --mixed --hard --soft --patch"
return
;;
esac
@@ -1876,18 +1876,30 @@ _git_show_branch ()
_git_stash ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local save_opts='--keep-index --no-keep-index --quiet --patch'
local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
case "$cur" in
--*)
__gitcomp "$save_opts"
;;
*)
if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
__gitcomp "$subcommands"
else
COMPREPLY=()
fi
;;
esac
else
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$subcommand,$cur" in
save,--*)
__gitcomp "--keep-index"
__gitcomp "$save_opts"
;;
apply,--*|pop,--*)
__gitcomp "--index"
__gitcomp "--index --quiet"
;;
show,--*|drop,--*|branch,--*)
COMPREPLY=()
@@ -1908,7 +1920,7 @@ _git_submodule ()
__git_has_doubledash && return
local subcommands="add status init update summary foreach sync"
if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -1930,7 +1942,7 @@ _git_svn ()
proplist show-ignore show-externals branch tag blame
migrate
"
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
else

View File

@@ -89,6 +89,7 @@ error_on_no_merge_candidates () {
done
curr_branch=${curr_branch#refs/heads/}
upstream=$(git config "branch.$curr_branch.merge")
if [ -z "$curr_branch" ]; then
echo "You are not currently on a branch, so I cannot use any"
@@ -96,7 +97,7 @@ error_on_no_merge_candidates () {
echo "Please specify which branch you want to merge on the command"
echo "line and try again (e.g. 'git pull <repository> <refspec>')."
echo "See git-pull(1) for details."
else
elif [ -z "$upstream" ]; then
echo "You asked me to pull without telling me which branch you"
echo "want to merge with, and 'branch.${curr_branch}.merge' in"
echo "your configuration file does not tell me either. Please"
@@ -114,6 +115,10 @@ error_on_no_merge_candidates () {
echo " remote.<nickname>.fetch = <refspec>"
echo
echo "See git-config(1) for details."
else
echo "Your configuration specifies to merge the ref"
echo "'${upstream#refs/heads/}' from the remote, but no such ref"
echo "was fetched."
fi
exit 1
}

View File

@@ -2526,6 +2526,7 @@ proc savestuff {w} {
if {$stuffsaved} return
if {![winfo viewable .]} return
catch {
if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
set f [open "~/.gitk-new" w]
if {$::tcl_platform(platform) eq {windows}} {
file attributes "~/.gitk-new" -hidden true
@@ -3168,6 +3169,28 @@ proc flist_hl {only} {
set gdttype [mc "touching paths:"]
}
proc gitknewtmpdir {} {
global diffnum gitktmpdir gitdir
if {![info exists gitktmpdir]} {
set gitktmpdir [file join [file dirname $gitdir] \
[format ".gitk-tmp.%s" [pid]]]
if {[catch {file mkdir $gitktmpdir} err]} {
error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err"
unset gitktmpdir
return {}
}
set diffnum 0
}
incr diffnum
set diffdir [file join $gitktmpdir $diffnum]
if {[catch {file mkdir $diffdir} err]} {
error_popup "[mc "Error creating temporary directory %s:" $diffdir] $err"
return {}
}
return $diffdir
}
proc save_file_from_commit {filename output what} {
global nullfile
@@ -3202,11 +3225,10 @@ proc external_diff_get_one_file {diffid filename diffdir} {
}
proc external_diff {} {
global gitktmpdir nullid nullid2
global nullid nullid2
global flist_menu_file
global diffids
global diffnum
global gitdir extdifftool
global extdifftool
if {[llength $diffids] == 1} {
# no reference commit given
@@ -3228,22 +3250,8 @@ proc external_diff {} {
}
# make sure that several diffs wont collide
if {![info exists gitktmpdir]} {
set gitktmpdir [file join [file dirname $gitdir] \
[format ".gitk-tmp.%s" [pid]]]
if {[catch {file mkdir $gitktmpdir} err]} {
error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err"
unset gitktmpdir
return
}
set diffnum 0
}
incr diffnum
set diffdir [file join $gitktmpdir $diffnum]
if {[catch {file mkdir $diffdir} err]} {
error_popup "[mc "Error creating temporary directory %s:" $diffdir] $err"
return
}
set diffdir [gitknewtmpdir]
if {$diffdir eq {}} return
# gather files to diff
set difffromfile [external_diff_get_one_file $diffidfrom $flist_menu_file $diffdir]
@@ -7401,7 +7409,7 @@ proc getblobdiffline {bdf ids} {
$ctext conf -state normal
while {[incr nr] <= 1000 && [gets $bdf line] >= 0} {
if {$ids != $diffids || $bdf != $blobdifffd($ids)} {
close $bdf
catch {close $bdf}
return 0
}
if {![string compare -length 5 "diff " $line]} {
@@ -7553,7 +7561,7 @@ proc getblobdiffline {bdf ids} {
}
$ctext conf -state disabled
if {[eof $bdf]} {
close $bdf
catch {close $bdf}
return 0
}
return [expr {$nr >= 1000? 2: 1}]
@@ -8274,8 +8282,11 @@ proc do_cmp_commits {a b} {
appendshortlink $a [mc "Commit "] " $heada\n"
appendshortlink $b [mc " differs from\n "] \
" $headb\n"
$ctext insert end [mc "- stopping\n"]
break
$ctext insert end [mc "Diff of commits:\n\n"]
$ctext conf -state disabled
update
diffcommits $a $b
return
}
}
if {$skipa} {
@@ -8301,6 +8312,31 @@ proc do_cmp_commits {a b} {
$ctext conf -state disabled
}
proc diffcommits {a b} {
global diffcontext diffids blobdifffd diffinhdr
set tmpdir [gitknewtmpdir]
set fna [file join $tmpdir "commit-[string range $a 0 7]"]
set fnb [file join $tmpdir "commit-[string range $b 0 7]"]
if {[catch {
exec git diff-tree -p --pretty $a >$fna
exec git diff-tree -p --pretty $b >$fnb
} err]} {
error_popup [mc "Error writing commit to file: %s" $err]
return
}
if {[catch {
set fd [open "| diff -U$diffcontext $fna $fnb" r]
} err]} {
error_popup [mc "Error diffing commits: %s" $err]
return
}
set diffids [list commits $a $b]
set blobdifffd($diffids) $fd
set diffinhdr 0
filerun $fd [list getblobdiffline $fd $diffids]
}
proc diffvssel {dirn} {
global rowmenuid selectedline

File diff suppressed because it is too large Load Diff

View File

@@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
echo ' cp private-Error.pm blib/lib/Error.pm' >> $@
echo install: >> $@
echo ' mkdir -p "$(instdir_SQ)"' >> $@
echo ' $(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
echo ' $(RM) "$(instdir_SQ)/Error.pm"' >> $@
echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
echo ' cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
echo ' cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
echo instlibdir: >> $@
echo ' echo $(instdir_SQ)' >> $@
else

View File

@@ -14,15 +14,18 @@ allownonascii=$(git config hooks.allownonascii)
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test "$(git diff --cached --name-only --diff-filter=A -z |
LC_ALL=C tr -d '[ -~]\0')"
then
echo "Error: Attempt to add a non-ascii filename."
echo "Error: Attempt to add a non-ascii file name."
echo
echo "This can cause problems if you want to work together"
echo "with people on other platforms than you."
echo "This can cause problems if you want to work"
echo "with people on other platforms."
echo
echo "To be portable it is adviseable to rename the file ..."
echo "To be portable it is advisable to rename the file ..."
echo
echo "If you know what you are doing you can disable this"
echo "check using:"

View File

@@ -4,8 +4,7 @@
* Copyright (C) 2007 by Nicolas Pitre, licensed under the GPL version 2.
*/
#include <stdio.h>
#include <stdlib.h>
#include "git-compat-util.h"
int main(int argc, char *argv[])
{