Skip to content

Commit 8fedb83

Browse files
author
Junio C Hamano
committed
GIT 1.1.6
2 parents 2111168 + f0fff36 commit 8fedb83

File tree

5 files changed

+30
-15
lines changed

5 files changed

+30
-15
lines changed

Documentation/git-branch.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ git-branch - Create a new branch, or remove an old one.
77

88
SYNOPSIS
99
--------
10-
'git-branch' [-d | -D] [<branchname> [start-point]]
10+
'git-branch' [(-d | -D) <branchname>] | [[-f] <branchname> [<start-point>]]
1111

1212
DESCRIPTION
1313
-----------
@@ -25,10 +25,13 @@ OPTIONS
2525
-D::
2626
Delete a branch irrespective of its index status.
2727

28+
-f::
29+
Force a reset of <branchname> to <start-point> (or current head).
30+
2831
<branchname>::
2932
The name of the branch to create or delete.
3033

31-
start-point::
34+
<start-point>::
3235
Where to create the branch; defaults to HEAD. This
3336
option has no meaning with -d and -D.
3437

Documentation/git-push.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ include::pull-fetch-param.txt[]
3030
to be pushed.
3131

3232
-f, \--force::
33-
Usually, the command refuses to update a local ref that is
34-
not an ancestor of the remote ref used to overwrite it.
35-
This flag disables the check. What this means is that the
36-
local repository can lose commits; use it with care.
33+
Usually, the command refuses to update a remote ref that is
34+
not a descendent of the local ref used to overwrite it.
35+
This flag disables the check. This can cause the
36+
remote repository to lose commits; use it with care.
3737

3838

3939
Author

git-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
USAGE='[-d <branch>] | [[-f] <branch> [start-point]]'
3+
USAGE='[(-d | -D) <branchname>] | [[-f] <branchname> [<start-point>]]'
44
LONG_USAGE='If no arguments, show available branches and mark current branch with a star.
55
If one argument, create a new branch <branchname> based off of current HEAD.
66
If two arguments, create a new branch <branchname> based off of <start-point>.'

git-merge-recursive.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,16 @@ def mergeFile(oPath, oSha, oMode, aPath, aSha, aMode, bPath, bSha, bMode,
205205
orig = runProgram(['git-unpack-file', oSha]).rstrip()
206206
src1 = runProgram(['git-unpack-file', aSha]).rstrip()
207207
src2 = runProgram(['git-unpack-file', bSha]).rstrip()
208-
[out, code] = runProgram(['merge',
209-
'-L', branch1Name + '/' + aPath,
210-
'-L', 'orig/' + oPath,
211-
'-L', branch2Name + '/' + bPath,
212-
src1, orig, src2], returnCode=True)
208+
try:
209+
[out, code] = runProgram(['merge',
210+
'-L', branch1Name + '/' + aPath,
211+
'-L', 'orig/' + oPath,
212+
'-L', branch2Name + '/' + bPath,
213+
src1, orig, src2], returnCode=True)
214+
except ProgramError, e:
215+
print >>sys.stderr, e
216+
die("Failed to execute 'merge'. merge(1) is used as the "
217+
"file-level merge tool. Is 'merge' in your path?")
213218

214219
sha = runProgram(['git-hash-object', '-t', 'blob', '-w',
215220
src1]).rstrip()

templates/hooks--pre-commit

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@
1010
# This is slightly modified from Andrew Morton's Perfect Patch.
1111
# Lines you introduce should not have trailing whitespace.
1212
# Also check for an indentation that has SP before a TAB.
13+
14+
if git-rev-parse --verify HEAD 2>/dev/null
15+
then
16+
git-diff-index -p -M --cached HEAD
17+
else
18+
# NEEDSWORK: we should produce a diff with an empty tree here
19+
# if we want to do the same verification for the initial import.
20+
:
21+
fi |
1322
perl -e '
14-
my $fh;
1523
my $found_bad = 0;
1624
my $filename;
1725
my $reported_filename = "";
@@ -31,8 +39,7 @@ perl -e '
3139
print STDERR "* $why (line $lineno)\n";
3240
print STDERR "$filename:$lineno:$line\n";
3341
}
34-
open $fh, "-|", qw(git-diff-index -p -M --cached HEAD);
35-
while (<$fh>) {
42+
while (<>) {
3643
if (m|^diff --git a/(.*) b/\1$|) {
3744
$filename = $1;
3845
next;

0 commit comments

Comments
 (0)