Skip to content

Commit

Permalink
Merge branch 'master' of .
Browse files Browse the repository at this point in the history
  • Loading branch information
Junio C Hamano committed Sep 13, 2005
2 parents c52b60a + 2aba319 commit 3db6b22
Show file tree
Hide file tree
Showing 12 changed files with 181 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ git-fetch-pack
git-format-patch
git-fsck-objects
git-get-tar-commit-id
git-grep
git-hash-object
git-http-fetch
git-init-db
Expand Down
47 changes: 47 additions & 0 deletions Documentation/git-grep.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
git-grep(1)
===========
v0.99.6, Sep 2005

NAME
----
git-grep - print lines matching a pattern


SYNOPSIS
--------
'git-grep' <option>... <pattern> <path>...

DESCRIPTION
-----------
Searches list of files `git-ls-files` produces for lines
containing a match to the given pattern.


OPTIONS
-------
<option>...::
Either an option to pass to `grep` or `git-ls-files`.
Some `grep` options, such as `-C` and `-m`, that take
parameters are known to `git-grep`.

<pattern>::
The pattern to look for.

<path>...::

Optional paths to limit the set of files to be searched;
passed to `git-ls-files`.


Author
------
Written by Linus Torvalds <torvalds@osdl.org>

Documentation
--------------
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.

GIT
---
Part of the link:git.html[git] suite

9 changes: 6 additions & 3 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
git(7)
======
v0.99.5, Aug 2005
v0.99.6, Sep 2005

NAME
----
Expand Down Expand Up @@ -238,17 +238,20 @@ link:git-commit.html[git-commit]::
Previously this command was known as git-commit-script.

link:git-diff.html[git-diff]::
git-diff.
Show changes between commits, commit and working tree, etc.
Previously this command was known as git-diff-script.

link:git-fetch.html[git-fetch]::
Download from a remote repository via various protocols.
Previously this command was known as git-fetch-script.

link:git-format-patch.html[git-format-patch]::
git-format-patch.
Prepare patches for e-mail submission.
Previously this command was known as git-format-patch-script.

link:git-grep.html[git-grep]::
Print lines matching a pattern

link:git-log.html[git-log]::
Shows commit logs.
Previously this command was known as git-log-script.
Expand Down
5 changes: 5 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,8 @@ Issues of note:
You'll only need the merge program if you do development using
git, and if you only use git to track other peoples work you'll
never notice the lack of it.

- "wish", the TCL/Tk windowing shell is used in gitk to show the
history graphically

- "ssh" is used to push and pull over the net
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SCRIPT_SH = \
git-tag.sh git-verify-tag.sh git-whatchanged.sh git.sh \
git-applymbox.sh git-applypatch.sh \
git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
git-merge-resolve.sh
git-merge-resolve.sh git-grep.sh

SCRIPT_PERL = \
git-archimport.perl git-cvsimport.perl git-relink.perl \
Expand Down
11 changes: 11 additions & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@
* Your search - "port 9418" - did not match any documents.
*
* as www.google.com puts it.
*
* This port has been properly assigned for git use by IANA:
* git (Assigned-9418) [I06-050728-0001].
*
* git 9418/tcp git pack transfer service
* git 9418/udp git pack transfer service
*
* with Linus Torvalds <torvalds@osdl.org> as the point of
* contact. September 2005.
*
* See http://www.iana.org/assignments/port-numbers
*/
#define DEFAULT_GIT_PORT 9418

Expand Down
1 change: 1 addition & 0 deletions git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ then
git-read-tree --reset $new &&
git-checkout-index -q -f -u -a
else
git-update-index --refresh >/dev/null
git-read-tree -m -u $old $new
fi

Expand Down
10 changes: 7 additions & 3 deletions git-core.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ URL: http://kernel.org/pub/software/scm/git/
Source: http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
BuildRequires: zlib-devel, openssl-devel, curl-devel %{!?_without_docs:, xmlto, asciidoc > 6.0.3}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: sh-utils, diffutils, rsync, rcs, python >= 2.4
Requires: sh-utils, curl, diffutils, rsync, rcs, openssh-clients, perl, python >= 2.4, tk

%description
This is a stupid (but extremely fast) directory content manager. It
Expand Down Expand Up @@ -40,10 +40,14 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/git-core/templates/*
%doc README COPYING Documentation/*.txt
%{!?_without_docs: %doc Documentation/*.html }
%{!?_without_docs: %{_mandir}/man1/*.1.gz}
%{!?_without_docs: %{_mandir}/man7/*.7.gz}
%{!?_without_docs: %{_mandir}/man1/*.1*}
%{!?_without_docs: %{_mandir}/man7/*.7*}

%changelog
* Sun Sep 11 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
- Updated dependencies
- Don't assume manpages are gzipped

* Sun Aug 07 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
- Redid the description
- Cut overlong make line, loosened changelog a bit
Expand Down
38 changes: 27 additions & 11 deletions git-format-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ with applymbox.
}

diff_opts=
IFS='
'
LF='
'

Expand Down Expand Up @@ -61,7 +59,10 @@ do
--output-directo|--output-director|--output-directory)
case "$#" in 1) usage ;; esac; shift
outdir="$1" ;;
-*) diff_opts="$diff_opts$LF$1" ;;
-*' '* | -*"$LF"* | -*' '*)
# Ignore diff option that has whitespace for now.
;;
-*) diff_opts="$diff_opts$1 " ;;
*) break ;;
esac
shift
Expand All @@ -72,16 +73,20 @@ tt)
die '--keep-subject and --numbered are incompatible.' ;;
esac

revpair=
rev1= rev2=
case "$#" in
2)
revpair="$1..$2" ;;
rev1="$1" rev2="$2" ;;
1)
case "$1" in
*..*)
revpair="$1";;
rev1=`expr "$1" : '\(.*\)\.\.'`
rev2=`expr "$1" : '.*\.\.\(.*\)'`
;;
*)
revpair="$1..HEAD";;
rev1="$1"
rev2="HEAD"
;;
esac ;;
*)
usage ;;
Expand Down Expand Up @@ -127,10 +132,21 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
stripCommitHead='/^'"$_x40"' (from '"$_x40"')$/d'

git-rev-list --no-merges --merge-order \
$(git-rev-parse --revs-only "$revpair") >$series
git-cherry -v "$rev1" "$rev2" |
while read sign rev comment
do
case "$sign" in
'-')
echo >&2 "Merged already: $comment"
;;
*)
echo $rev
;;
esac
done >$series

total=`wc -l <$series | tr -dc "[0-9]"`
i=$total
i=1
while read commit
do
git-cat-file commit "$commit" | git-stripspace >$commsg
Expand All @@ -145,7 +161,7 @@ do
esac

file=`printf '%04d-%stxt' $i "$title"`
i=`expr "$i" - 1`
i=`expr "$i" + 1`
echo "* $file"
{
mailScript='
Expand Down
43 changes: 43 additions & 0 deletions git-grep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh
#
# Copyright (c) Linus Torvalds, 2005
#

pattern=
flags=()
git_flags=()
while : ; do
case "$1" in
--cached|--deleted|--others|--killed|\
--ignored|--exclude=*|\
--exclude-from=*|\--exclude-per-directory=*)
git_flags=("${git_flags[@]}" "$1")
;;
-e)
pattern="$2"
shift
;;
-A|-B|-C|-D|-d|-f|-m)
flags=("${flags[@]}" "$1" "$2")
shift
;;
--)
# The rest are git-ls-files paths (or flags)
shift
break
;;
-*)
flags=("${flags[@]}" "$1")
;;
*)
if [ -z "$pattern" ]; then
pattern="$1"
shift
fi
break
;;
esac
shift
done
git-ls-files -z "${git_flags[@]}" "$@" |
xargs -0 grep "${flags[@]}" "$pattern"
39 changes: 21 additions & 18 deletions git-merge-fredrik.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

import sys, math, random, os, re, signal, tempfile, stat, errno
import sys, math, random, os, re, signal, tempfile, stat, errno, traceback
from heapq import heappush, heappop
from sets import Set

Expand Down Expand Up @@ -60,7 +60,7 @@ def infoMsg(*args):
branch1Name, branch2Name,
cleanCache, updateWd)

if clean or alwaysWriteTree:
if clean or cleanCache:
res = Commit(None, [h1, h2], tree=shaRes)
graph.addNode(res)
else:
Expand Down Expand Up @@ -120,9 +120,8 @@ def unmergedCacheEntries():
e.stages[stage].mode = mode
e.stages[stage].sha1 = sha1
else:
print 'Error: Merge program failed: Unexpected output from', \
'git-ls-files:', l
sys.exit(2)
die('Error: Merge program failed: Unexpected output from', \
'git-ls-files:', l)
return res

def mergeTrees(head, merge, common, branch1Name, branch2Name,
Expand Down Expand Up @@ -381,26 +380,25 @@ def uniquePath(path, branch):
os.unlink(src1)
os.unlink(src2)
else:
print 'ERROR: Fatal merge failure.'
print "ERROR: Shouldn't happen"
sys.exit(2)
die("ERROR: Fatal merge failure, shouldn't happen.")

return cleanMerge

def usage():
print 'Usage:', sys.argv[0], ' <base>... -- <head> <remote>..'
sys.exit(2)
die('Usage:', sys.argv[0], ' <base>... -- <head> <remote>..')

# main entry point as merge strategy module
# The first parameters up to -- are merge bases, and the rest are heads.
# This strategy module figures out merge bases itself, so we only
# get heads.

if len(sys.argv) < 4:
usage()

for nextArg in xrange(1, len(sys.argv)):
if sys.argv[nextArg] == '--':
if len(sys.argv) != nextArg + 3:
print 'Not handling anything other than two heads merge.'
sys.exit(2)
die('Not handling anything other than two heads merge.')
try:
h1 = firstBranch = sys.argv[nextArg + 1]
h2 = secondBranch = sys.argv[nextArg + 2]
Expand All @@ -409,15 +407,20 @@ def usage():
break

print 'Merging', h1, 'with', h2
h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()

graph = buildGraph([h1, h2])
try:
h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()

[res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
firstBranch, secondBranch, graph)
graph = buildGraph([h1, h2])

print ''
[res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
firstBranch, secondBranch, graph)

print ''
except:
traceback.print_exc(None, sys.stderr)
sys.exit(2)

if clean:
sys.exit(0)
Expand Down
Loading

0 comments on commit 3db6b22

Please sign in to comment.