git-format-patch
git-fsck-objects
git-get-tar-commit-id
+git-grep
git-hash-object
git-http-fetch
git-init-db
--- /dev/null
+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
+
git(7)
======
-v0.99.5, Aug 2005
+v0.99.6, Sep 2005
NAME
----
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]::
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.
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
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 \
* 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
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
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
%{_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
}
diff_opts=
-IFS='
-'
LF='
'
--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
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 ;;
_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
esac
file=`printf '%04d-%stxt' $i "$title"`
- i=`expr "$i" - 1`
+ i=`expr "$i" + 1`
echo "* $file"
{
mailScript='
--- /dev/null
+#!/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"
#!/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
branch1Name, branch2Name,
cleanCache, updateWd)
- if clean or alwaysWriteTree:
+ if clean or cleanCache:
res = Commit(None, [h1, h2], tree=shaRes)
graph.addNode(res)
else:
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,
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]
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)
import subprocess
+def die(*args):
+ printList(args, sys.stderr)
+ sys.exit(2)
+
# Debugging machinery
# -------------------
if funcName in functionsToDebug:
printList(args)
-def printList(list):
+def printList(list, file=sys.stdout):
for x in list:
- sys.stdout.write(str(x))
- sys.stdout.write(' ')
- sys.stdout.write('\n')
+ file.write(str(x))
+ file.write(' ')
+ file.write('\n')
# Program execution
# -----------------
self.progStr = progStr
self.error = error
+ def __str__(self):
+ return self.progStr + ': ' + self.error
+
addDebug('runProgram')
def runProgram(prog, input=None, returnCode=False, env=None, pipeOutput=True):
debug('runProgram prog:', str(prog), 'input:', str(input))