Merge commit 'jc/maint' into gfi-maint
* commit 'jc/maint': (35 commits) Update git-http-fetch documentation Update git-local-fetch documentation Update git-http-push documentation Update -L documentation for git-blame/git-annotate Update git-grep documentation Update git-fmt-merge documentation Document additional options for git-fetch Removing -n option from git-diff-files documentation Start preparing for 1.5.1.3 Sanitize @to recipients. git-svn: Ignore usernames in URLs in find_by_url Document --dry-run and envelope-sender for git-send-email. Allow users to optionally specify their envelope sender. Ensure clean addresses are always used with Net::SMTP Validate @recipients before using it for sendmail and Net::SMTP. Perform correct quoting of recipient names. Change the scope of the $cc variable as it is not needed outside of send_message. Debugging cleanup improvements Prefix Dry- to the message status to denote dry-runs. Document --dry-run parameter to send-email. ...
This commit is contained in:
commit
ec771a7084
3
Documentation/.gitignore
vendored
3
Documentation/.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
*.xml
|
||||
*.html
|
||||
*.1
|
||||
*.7
|
||||
*.[1-8]
|
||||
*.made
|
||||
howto-index.txt
|
||||
doc.dep
|
||||
|
@ -1,4 +1,4 @@
|
||||
GIT v1.5.1.2 Release Notes (draft)
|
||||
GIT v1.5.1.2 Release Notes
|
||||
==========================
|
||||
|
||||
Fixes since v1.5.1.1
|
||||
@ -6,6 +6,11 @@ Fixes since v1.5.1.1
|
||||
|
||||
* Bugfixes
|
||||
|
||||
- "git clone" over http from a repository that has lost the
|
||||
loose refs by running "git pack-refs" were broken (a code to
|
||||
deal with this was added to "git fetch" in v1.5.0, but it
|
||||
was missing from "git clone").
|
||||
|
||||
- "git diff a/ b/" incorrectly fell in "diff between two
|
||||
filesystem objects" codepath, when the user most likely
|
||||
wanted to limit the extent of output to two tracked
|
||||
@ -24,14 +29,22 @@ Fixes since v1.5.1.1
|
||||
- git-blame on a very long working tree path had buffer
|
||||
overrun problem.
|
||||
|
||||
- git-apply did not like to be fed two patches in a row that created
|
||||
and then modified the same file.
|
||||
|
||||
- git-svn was confused when a non-project was stored directly under
|
||||
trunk/, branches/ and tags/.
|
||||
|
||||
- git-svn wants the Error.pm module that was at least as new
|
||||
as what we ship as part of git; install ours in our private
|
||||
installation location if the one on the system is older.
|
||||
|
||||
- An earlier update to command line integer parameter parser was
|
||||
botched and made 'update-index --cacheinfo' completely useless.
|
||||
|
||||
|
||||
* Documentation updates
|
||||
|
||||
- Various documentation updates from J. Bruce Fields, Frank
|
||||
Lichtenheld, Alex Riesen and others. Andrew Ruder started a
|
||||
war on undocumented options.
|
||||
|
||||
---
|
||||
exec >/var/tmp/1
|
||||
O=v1.5.1.1-31-g0220f1e
|
||||
echo O=`git describe refs/heads/maint`
|
||||
git shortlog --no-merges $O..refs/heads/maint
|
||||
|
38
Documentation/RelNotes-1.5.1.3.txt
Normal file
38
Documentation/RelNotes-1.5.1.3.txt
Normal file
@ -0,0 +1,38 @@
|
||||
GIT v1.5.1.3 Release Notes (draft)
|
||||
==========================
|
||||
|
||||
Fixes since v1.5.1.2
|
||||
--------------------
|
||||
|
||||
* Bugfixes
|
||||
|
||||
- git-add tried to optimize by finding common leading
|
||||
directories across its arguments but botched, causing very
|
||||
confused behaviour.
|
||||
|
||||
- unofficial rpm.spec file shipped with git was letting
|
||||
ETC_GITCONFIG set to /usr/etc/gitconfig. Tweak the official
|
||||
Makefile to make it harder for distro people to make the
|
||||
same mistake, by setting the variable to /etc/gitconfig if
|
||||
prefix is set to /usr.
|
||||
|
||||
- git-svn inconsistently stripped away username from the URL
|
||||
only when svnsync_props was in use.
|
||||
|
||||
- git-send-email was not quoting recipient names that have
|
||||
period '.' in them. Also it did not allow overriding
|
||||
envelope sender, which made it impossible to send patches to
|
||||
certain subscriber-only lists.
|
||||
|
||||
- built-in write_tree() routine had a sequence that renamed a
|
||||
file that is still open, which some systems did not like.
|
||||
|
||||
- when memory is very tight, sliding mmap code to read
|
||||
packfiles incorrectly closed the fd that was still being
|
||||
used to read the pack.
|
||||
|
||||
---
|
||||
exec >/var/tmp/1
|
||||
O=v1.5.1.2-23-gbf7af11
|
||||
echo O=`git describe refs/heads/maint`
|
||||
git shortlog --no-merges $O..refs/heads/maint
|
@ -9,8 +9,28 @@
|
||||
--show-stats::
|
||||
Include additional statistics at the end of blame output.
|
||||
|
||||
-L n,m::
|
||||
Annotate only the specified line range (lines count from 1).
|
||||
-L <start>,<end>::
|
||||
Annotate only the given line range. <start> and <end> can take
|
||||
one of these forms:
|
||||
|
||||
- number
|
||||
+
|
||||
If <start> or <end> is a number, it specifies an
|
||||
absolute line number (lines count from 1).
|
||||
+
|
||||
|
||||
- /regex/
|
||||
+
|
||||
This form will use the first line matching the given
|
||||
POSIX regex. If <end> is a regex, it will search
|
||||
starting at the line given by <start>.
|
||||
+
|
||||
|
||||
- +offset or -offset
|
||||
+
|
||||
This is only valid for <end> and will specify a number
|
||||
of lines before or after the line given by <start>.
|
||||
+
|
||||
|
||||
-l::
|
||||
Show long rev (Default: off).
|
||||
|
@ -1,13 +1,20 @@
|
||||
-q, \--quiet::
|
||||
Pass --quiet to git-fetch-pack and silence any other internally
|
||||
used programs.
|
||||
|
||||
-v, \--verbose::
|
||||
Be verbose.
|
||||
|
||||
-a, \--append::
|
||||
Append ref names and object names of fetched refs to the
|
||||
existing contents of `.git/FETCH_HEAD`. Without this
|
||||
option old data in `.git/FETCH_HEAD` will be overwritten.
|
||||
|
||||
\--upload-pack <upload-pack>::
|
||||
When given, and the repository to fetch from is handled
|
||||
by 'git-fetch-pack', '--exec=<upload-pack>' is passed to
|
||||
the command to specify non-default path for the command
|
||||
run on the other end.
|
||||
When given, and the repository to fetch from is handled
|
||||
by 'git-fetch-pack', '--exec=<upload-pack>' is passed to
|
||||
the command to specify non-default path for the command
|
||||
run on the other end.
|
||||
|
||||
-f, \--force::
|
||||
When `git-fetch` is used with `<rbranch>:<lbranch>`
|
||||
@ -16,7 +23,7 @@
|
||||
fetches is a descendant of `<lbranch>`. This option
|
||||
overrides that check.
|
||||
|
||||
\--no-tags::
|
||||
-n, \--no-tags::
|
||||
By default, `git-fetch` fetches tags that point at
|
||||
objects that are downloaded from the remote repository
|
||||
and stores them locally. This option disables this
|
||||
|
@ -8,7 +8,7 @@ git-checkout - Checkout and switch to a branch
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git-checkout' [-q] [-f] [-b [--track | --no-track] <new_branch> [-l]] [-m] [<branch>]
|
||||
'git-checkout' [-q] [-f] [[--track | --no-track] -b <new_branch> [-l]] [-m] [<branch>]
|
||||
'git-checkout' [<tree-ish>] <paths>...
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -8,7 +8,7 @@ git-diff-files - Compares files in the working tree and the index
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
'git-diff-files' [-q] [-0|-1|-2|-3|-c|--cc|-n|--no-index] [<common diff options>] [<path>...]
|
||||
'git-diff-files' [-q] [-0|-1|-2|-3|-c|--cc|--no-index] [<common diff options>] [<path>...]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@ -36,7 +36,7 @@ omit diff output for unmerged entries and just show "Unmerged".
|
||||
diff, similar to the way 'diff-tree' shows a merge
|
||||
commit with these flags.
|
||||
|
||||
\-n,\--no-index::
|
||||
--no-index::
|
||||
Compare the two given files / directories.
|
||||
|
||||
-q::
|
||||
|
@ -8,7 +8,8 @@ git-fmt-merge-msg - Produce a merge commit message
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
'git-fmt-merge-msg' <$GIT_DIR/FETCH_HEAD
|
||||
git-fmt-merge-msg [--summary | --no-summary] <$GIT_DIR/FETCH_HEAD
|
||||
git-fmt-merge-msg [--summary | --no-summray] -F <file>
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@ -19,6 +20,28 @@ passed as the '<merge-message>' argument of `git-merge`.
|
||||
This script is intended mostly for internal use by scripts
|
||||
automatically invoking `git-merge`.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
|
||||
--summary::
|
||||
In addition to branch names, populate the log message with
|
||||
one-line descriptions from the actual commits that are being
|
||||
merged.
|
||||
|
||||
--no-summary::
|
||||
Do not list one-line descriptions from the actual commits being
|
||||
merged.
|
||||
|
||||
--file <file>, -F <file>::
|
||||
Take the list of merged objects from <file> instead of
|
||||
stdin.
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
merge.summary::
|
||||
Whether to include summaries of merged commits in newly
|
||||
merge commit messages. False by default.
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
|
@ -12,12 +12,13 @@ SYNOPSIS
|
||||
'git-grep' [--cached]
|
||||
[-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
|
||||
[-v | --invert-match] [-h|-H] [--full-name]
|
||||
[-E | --extended-regexp] [-G | --basic-regexp] [-F | --fixed-strings]
|
||||
[-n] [-l | --files-with-matches] [-L | --files-without-match]
|
||||
[-E | --extended-regexp] [-G | --basic-regexp]
|
||||
[-F | --fixed-strings] [-n]
|
||||
[-l | --files-with-matches] [-L | --files-without-match]
|
||||
[-c | --count] [--all-match]
|
||||
[-A <post-context>] [-B <pre-context>] [-C <context>]
|
||||
[-f <file>] [-e] <pattern> [--and|--or|--not|(|)|-e <pattern>...]
|
||||
[<tree>...]
|
||||
[-f <file>] [-e] <pattern>
|
||||
[--and|--or|--not|(|)|-e <pattern>...] [<tree>...]
|
||||
[--] [<path>...]
|
||||
|
||||
DESCRIPTION
|
||||
@ -39,6 +40,9 @@ OPTIONS
|
||||
Ignore case differences between the patterns and the
|
||||
files.
|
||||
|
||||
-I::
|
||||
Don't match the pattern in binary files.
|
||||
|
||||
-w | --word-regexp::
|
||||
Match the pattern only at word boundary (either begin at the
|
||||
beginning of a line, or preceded by a non-word character; end at
|
||||
@ -64,6 +68,10 @@ OPTIONS
|
||||
Use POSIX extended/basic regexp for patterns. Default
|
||||
is to use basic regexp.
|
||||
|
||||
-F | --fixed-strings::
|
||||
Use fixed strings for patterns (don't interpret pattern
|
||||
as a regex).
|
||||
|
||||
-n::
|
||||
Prefix the line number to matching lines.
|
||||
|
||||
@ -81,6 +89,9 @@ OPTIONS
|
||||
line containing `--` between contiguous groups of
|
||||
matches.
|
||||
|
||||
-<num>::
|
||||
A shortcut for specifying -C<num>.
|
||||
|
||||
-f <file>::
|
||||
Read patterns from <file>, one per line.
|
||||
|
||||
|
@ -39,6 +39,10 @@ commit-id::
|
||||
|
||||
<commit-id>['\t'<filename-as-in--w>]
|
||||
|
||||
--recover::
|
||||
Verify that everything reachable from target is fetched. Used after
|
||||
an earlier fetch is interrupted.
|
||||
|
||||
Author
|
||||
------
|
||||
Written by Linus Torvalds <torvalds@osdl.org>
|
||||
|
@ -8,7 +8,7 @@ git-http-push - Push objects over HTTP/DAV to another repository
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
'git-http-push' [--complete] [--force] [--verbose] <url> <ref> [<ref>...]
|
||||
'git-http-push' [--all] [--force] [--verbose] <url> <ref> [<ref>...]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@ -18,7 +18,7 @@ remote branch.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
--complete::
|
||||
--all::
|
||||
Do not assume that the remote repository is complete in its
|
||||
current state, and verify all objects in the entire local
|
||||
ref's history exist in the remote repository.
|
||||
@ -34,6 +34,15 @@ OPTIONS
|
||||
Report the list of objects being walked locally and the
|
||||
list of objects successfully sent to the remote repository.
|
||||
|
||||
-d, -D::
|
||||
Remove <ref> from remote repository. The specified branch
|
||||
cannot be the remote HEAD. If -d is specified the following
|
||||
other conditions must also be met:
|
||||
|
||||
- Remote HEAD must resolve to an object that exists locally
|
||||
- Specified branch resolves to an object that exists locally
|
||||
- Specified branch is an ancestor of the remote HEAD
|
||||
|
||||
<ref>...::
|
||||
The remote refs to update.
|
||||
|
||||
|
@ -24,6 +24,16 @@ OPTIONS
|
||||
Get all the objects.
|
||||
-v::
|
||||
Report what is downloaded.
|
||||
-s::
|
||||
Instead of regular file-to-file copying use symbolic links to the objects
|
||||
in the remote repository.
|
||||
-l::
|
||||
Before attempting symlinks (if -s is specified) or file-to-file copying the
|
||||
remote objects, try to hardlink the remote objects into the local
|
||||
repository.
|
||||
-n::
|
||||
Never attempt to file-to-file copy remote objects. Only useful with
|
||||
-s or -l command-line options.
|
||||
|
||||
-w <filename>::
|
||||
Writes the commit-id into the filename under $GIT_DIR/refs/<filename> on
|
||||
@ -35,6 +45,10 @@ OPTIONS
|
||||
|
||||
<commit-id>['\t'<filename-as-in--w>]
|
||||
|
||||
--recover::
|
||||
Verify that everything reachable from target is fetched. Used after
|
||||
an earlier fetch is interrupted.
|
||||
|
||||
Author
|
||||
------
|
||||
Written by Junio C Hamano <junkio@cox.net>
|
||||
|
@ -67,6 +67,8 @@ message, or both. Leaves working tree as it was before "reset".
|
||||
<3> "reset" copies the old head to .git/ORIG_HEAD; redo the
|
||||
commit by starting with its log message. If you do not need to
|
||||
edit the message further, you can give -C option instead.
|
||||
+
|
||||
See also the --amend option to gitlink:git-commit[1].
|
||||
|
||||
Undo commits permanently::
|
||||
+
|
||||
|
@ -85,6 +85,15 @@ The --cc option must be repeated for each user you want on the cc list.
|
||||
Do not add the From: address to the cc: list, if it shows up in a From:
|
||||
line.
|
||||
|
||||
--dry-run::
|
||||
Do everything except actually send the emails.
|
||||
|
||||
--envelope-sender::
|
||||
Specify the envelope sender used to send the emails.
|
||||
This is useful if your default address is not the address that is
|
||||
subscribed to a list. If you use the sendmail binary, you must have
|
||||
suitable privileges for the -f parameter.
|
||||
|
||||
--to::
|
||||
Specify the primary recipient of the emails generated.
|
||||
Generally, this will be the upstream maintainer of the
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v1.5.1.1.GIT
|
||||
DEF_VER=v1.5.1.2.GIT
|
||||
|
||||
LF='
|
||||
'
|
||||
|
9
Makefile
9
Makefile
@ -133,7 +133,12 @@ prefix = $(HOME)
|
||||
bindir = $(prefix)/bin
|
||||
gitexecdir = $(bindir)
|
||||
template_dir = $(prefix)/share/git-core/templates/
|
||||
ETC_GITCONFIG = $(prefix)/etc/gitconfig
|
||||
ifeq ($(prefix),/usr)
|
||||
sysconfdir = /etc
|
||||
else
|
||||
sysconfdir = $(prefix)/etc
|
||||
endif
|
||||
ETC_GITCONFIG = $(sysconfdir)/gitconfig
|
||||
# DESTDIR=
|
||||
|
||||
# default configuration for gitweb
|
||||
@ -152,7 +157,7 @@ GITWEB_FAVICON = git-favicon.png
|
||||
GITWEB_SITE_HEADER =
|
||||
GITWEB_SITE_FOOTER =
|
||||
|
||||
export prefix bindir gitexecdir template_dir
|
||||
export prefix bindir gitexecdir template_dir sysconfdir
|
||||
|
||||
CC = gcc
|
||||
AR = ar
|
||||
|
2
RelNotes
2
RelNotes
@ -1 +1 @@
|
||||
Documentation/RelNotes-1.5.1.2.txt
|
||||
Documentation/RelNotes-1.5.1.3.txt
|
@ -10,7 +10,7 @@
|
||||
#include "builtin.h"
|
||||
|
||||
static const char diff_files_usage[] =
|
||||
"git-diff-files [-q] [-0/-1/2/3 |-c|--cc|-n|--no-index] [<common diff options>] [<path>...]"
|
||||
"git-diff-files [-q] [-0/-1/2/3 |-c|--cc|--no-index] [<common diff options>] [<path>...]"
|
||||
COMMON_DIFF_OPTIONS_HELP;
|
||||
|
||||
int cmd_diff_files(int argc, const char **argv, const char *prefix)
|
||||
|
@ -36,8 +36,10 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix)
|
||||
die("git-write-tree: error building trees");
|
||||
if (0 <= newfd) {
|
||||
if (!write_cache(newfd, active_cache, active_nr)
|
||||
&& !close(newfd))
|
||||
&& !close(newfd)) {
|
||||
commit_lock_file(lock_file);
|
||||
newfd = -1;
|
||||
}
|
||||
}
|
||||
/* Not being able to write is fine -- we are only interested
|
||||
* in updating the cache-tree part, and if the next caller
|
||||
@ -55,6 +57,8 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix)
|
||||
else
|
||||
hashcpy(sha1, active_cache_tree->sha1);
|
||||
|
||||
if (0 <= newfd)
|
||||
close(newfd);
|
||||
rollback_lock_file(lock_file);
|
||||
|
||||
return 0;
|
||||
|
3
dir.c
3
dir.c
@ -24,8 +24,9 @@ int common_prefix(const char **pathspec)
|
||||
prefix = slash - path + 1;
|
||||
while ((next = *++pathspec) != NULL) {
|
||||
int len = strlen(next);
|
||||
if (len >= prefix && !memcmp(path, next, len))
|
||||
if (len >= prefix && !memcmp(path, next, prefix))
|
||||
continue;
|
||||
len = prefix - 1;
|
||||
for (;;) {
|
||||
if (!len)
|
||||
return 0;
|
||||
|
@ -291,7 +291,7 @@ do
|
||||
<"$dotest/$msgnum" >"$dotest/info" ||
|
||||
stop_here $this
|
||||
test -s $dotest/patch || {
|
||||
echo "Patch is empty. Was is split wrong?"
|
||||
echo "Patch is empty. Was it split wrong?"
|
||||
stop_here $this
|
||||
}
|
||||
git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
|
||||
|
@ -78,7 +78,7 @@ do
|
||||
git-mailinfo $keep_subject $utf8 \
|
||||
.dotest/msg .dotest/patch <$i >.dotest/info || exit 1
|
||||
test -s .dotest/patch || {
|
||||
echo "Patch is empty. Was is split wrong?"
|
||||
echo "Patch is empty. Was it split wrong?"
|
||||
exit 1
|
||||
}
|
||||
git-stripspace < .dotest/msg > .dotest/msg-clean
|
||||
|
@ -60,7 +60,7 @@ Perhaps git-update-server-info needs to be run there?"
|
||||
else
|
||||
tname=$name
|
||||
fi
|
||||
git-http-fetch $v -a -w "$tname" "$name" "$1" || exit 1
|
||||
git-http-fetch $v -a -w "$tname" "$sha1" "$1" || exit 1
|
||||
done <"$clone_tmp/refs"
|
||||
rm -fr "$clone_tmp"
|
||||
http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" ||
|
||||
|
@ -156,13 +156,13 @@ extern size_t gitstrlcpy(char *, const char *, size_t);
|
||||
extern uintmax_t gitstrtoumax(const char *, char **, int);
|
||||
#endif
|
||||
|
||||
extern void release_pack_memory(size_t);
|
||||
extern void release_pack_memory(size_t, int);
|
||||
|
||||
static inline char* xstrdup(const char *str)
|
||||
{
|
||||
char *ret = strdup(str);
|
||||
if (!ret) {
|
||||
release_pack_memory(strlen(str) + 1);
|
||||
release_pack_memory(strlen(str) + 1, -1);
|
||||
ret = strdup(str);
|
||||
if (!ret)
|
||||
die("Out of memory, strdup failed");
|
||||
@ -176,7 +176,7 @@ static inline void *xmalloc(size_t size)
|
||||
if (!ret && !size)
|
||||
ret = malloc(1);
|
||||
if (!ret) {
|
||||
release_pack_memory(size);
|
||||
release_pack_memory(size, -1);
|
||||
ret = malloc(size);
|
||||
if (!ret && !size)
|
||||
ret = malloc(1);
|
||||
@ -195,7 +195,7 @@ static inline void *xrealloc(void *ptr, size_t size)
|
||||
if (!ret && !size)
|
||||
ret = realloc(ptr, 1);
|
||||
if (!ret) {
|
||||
release_pack_memory(size);
|
||||
release_pack_memory(size, -1);
|
||||
ret = realloc(ptr, size);
|
||||
if (!ret && !size)
|
||||
ret = realloc(ptr, 1);
|
||||
@ -211,7 +211,7 @@ static inline void *xcalloc(size_t nmemb, size_t size)
|
||||
if (!ret && (!nmemb || !size))
|
||||
ret = calloc(1, 1);
|
||||
if (!ret) {
|
||||
release_pack_memory(nmemb * size);
|
||||
release_pack_memory(nmemb * size, -1);
|
||||
ret = calloc(nmemb, size);
|
||||
if (!ret && (!nmemb || !size))
|
||||
ret = calloc(1, 1);
|
||||
@ -228,7 +228,7 @@ static inline void *xmmap(void *start, size_t length,
|
||||
if (ret == MAP_FAILED) {
|
||||
if (!length)
|
||||
return NULL;
|
||||
release_pack_memory(length);
|
||||
release_pack_memory(length, fd);
|
||||
ret = mmap(start, length, prot, flags, fd, offset);
|
||||
if (ret == MAP_FAILED)
|
||||
die("Out of memory? mmap failed: %s", strerror(errno));
|
||||
|
@ -74,7 +74,7 @@ for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do
|
||||
echo $patch_name
|
||||
(cat $QUILT_PATCHES/$patch_name | git-mailinfo "$tmp_msg" "$tmp_patch" > "$tmp_info") || exit 3
|
||||
test -s .dotest/patch || {
|
||||
echo "Patch is empty. Was is split wrong?"
|
||||
echo "Patch is empty. Was it split wrong?"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,10 @@ Options:
|
||||
--quiet Make git-send-email less verbose. One line per email
|
||||
should be all that is output.
|
||||
|
||||
--dry-run Do everything except actually send the emails.
|
||||
|
||||
--envelope-sender Specify the envelope sender used to send the emails.
|
||||
|
||||
EOT
|
||||
exit(1);
|
||||
}
|
||||
@ -137,6 +141,7 @@ my (@to,@cc,@initial_cc,@bcclist,@xh,
|
||||
my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc,
|
||||
$dry_run) = (1, 0, 0, 0, 0);
|
||||
my $smtp_server;
|
||||
my $envelope_sender;
|
||||
|
||||
# Example reply to:
|
||||
#$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
|
||||
@ -175,6 +180,7 @@ my $rc = GetOptions("from=s" => \$from,
|
||||
"suppress-from" => \$suppress_from,
|
||||
"no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc,
|
||||
"dry-run" => \$dry_run,
|
||||
"envelope-sender=s" => \$envelope_sender,
|
||||
);
|
||||
|
||||
unless ($rc) {
|
||||
@ -268,6 +274,7 @@ sub expand_aliases {
|
||||
}
|
||||
|
||||
@to = expand_aliases(@to);
|
||||
@to = (map { sanitize_address_rfc822($_) } @to);
|
||||
@initial_cc = expand_aliases(@initial_cc);
|
||||
@bcclist = expand_aliases(@bcclist);
|
||||
|
||||
@ -377,7 +384,7 @@ if (@files) {
|
||||
}
|
||||
|
||||
# Variables we set as part of the loop over files
|
||||
our ($message_id, $cc, %mail, $subject, $reply_to, $references, $message);
|
||||
our ($message_id, %mail, $subject, $reply_to, $references, $message);
|
||||
|
||||
sub extract_valid_address {
|
||||
my $address = shift;
|
||||
@ -418,7 +425,6 @@ sub make_message_id
|
||||
|
||||
|
||||
|
||||
$cc = "";
|
||||
$time = time - scalar $#files;
|
||||
|
||||
sub unquote_rfc2047 {
|
||||
@ -430,22 +436,33 @@ sub unquote_rfc2047 {
|
||||
return "$_";
|
||||
}
|
||||
|
||||
# If an address contains a . in the name portion, the name must be quoted.
|
||||
sub sanitize_address_rfc822
|
||||
{
|
||||
my ($recipient) = @_;
|
||||
my ($recipient_name) = ($recipient =~ /^(.*?)\s+</);
|
||||
if ($recipient_name && $recipient_name =~ /\./ && $recipient_name !~ /^".*"$/) {
|
||||
my ($name, $addr) = ($recipient =~ /^(.*?)(\s+<.*)/);
|
||||
$recipient = "\"$name\"$addr";
|
||||
}
|
||||
return $recipient;
|
||||
}
|
||||
|
||||
sub send_message
|
||||
{
|
||||
my @recipients = unique_email_list(@to);
|
||||
@cc = (map { sanitize_address_rfc822($_) } @cc);
|
||||
my $to = join (",\n\t", @recipients);
|
||||
@recipients = unique_email_list(@recipients,@cc,@bcclist);
|
||||
@recipients = (map { extract_valid_address($_) } @recipients);
|
||||
my $date = format_2822_time($time++);
|
||||
my $gitversion = '@@GIT_VERSION@@';
|
||||
if ($gitversion =~ m/..GIT_VERSION../) {
|
||||
$gitversion = Git::version();
|
||||
}
|
||||
|
||||
my ($author_name) = ($from =~ /^(.*?)\s+</);
|
||||
if ($author_name && $author_name =~ /\./ && $author_name !~ /^".*"$/) {
|
||||
my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
|
||||
$from = "\"$name\"$addr";
|
||||
}
|
||||
my $cc = join(", ", unique_email_list(@cc));
|
||||
$from = sanitize_address_rfc822($from);
|
||||
my $header = "From: $from
|
||||
To: $to
|
||||
Cc: $cc
|
||||
@ -463,22 +480,27 @@ X-Mailer: git-send-email $gitversion
|
||||
$header .= join("\n", @xh) . "\n";
|
||||
}
|
||||
|
||||
my @sendmail_parameters = ('-i', @recipients);
|
||||
my $raw_from = $from;
|
||||
$raw_from = $envelope_sender if (defined $envelope_sender);
|
||||
$raw_from = extract_valid_address($raw_from);
|
||||
unshift (@sendmail_parameters,
|
||||
'-f', $raw_from) if(defined $envelope_sender);
|
||||
|
||||
if ($dry_run) {
|
||||
# We don't want to send the email.
|
||||
} elsif ($smtp_server =~ m#^/#) {
|
||||
my $pid = open my $sm, '|-';
|
||||
defined $pid or die $!;
|
||||
if (!$pid) {
|
||||
exec($smtp_server,'-i',
|
||||
map { extract_valid_address($_) }
|
||||
@recipients) or die $!;
|
||||
exec($smtp_server, @sendmail_parameters) or die $!;
|
||||
}
|
||||
print $sm "$header\n$message";
|
||||
close $sm or die $?;
|
||||
} else {
|
||||
require Net::SMTP;
|
||||
$smtp ||= Net::SMTP->new( $smtp_server );
|
||||
$smtp->mail( $from ) or die $smtp->message;
|
||||
$smtp->mail( $raw_from ) or die $smtp->message;
|
||||
$smtp->to( @recipients ) or die $smtp->message;
|
||||
$smtp->data or die $smtp->message;
|
||||
$smtp->datasend("$header\n$message") or die $smtp->message;
|
||||
@ -486,13 +508,15 @@ X-Mailer: git-send-email $gitversion
|
||||
$smtp->ok or die "Failed to send $subject\n".$smtp->message;
|
||||
}
|
||||
if ($quiet) {
|
||||
printf "Sent %s\n", $subject;
|
||||
printf (($dry_run ? "Dry-" : "")."Sent %s\n", $subject);
|
||||
} else {
|
||||
print "OK. Log says:\nDate: $date\n";
|
||||
if ($smtp) {
|
||||
print (($dry_run ? "Dry-" : "")."OK. Log says:\nDate: $date\n");
|
||||
if ($smtp_server !~ m#^/#) {
|
||||
print "Server: $smtp_server\n";
|
||||
print "MAIL FROM:<$raw_from>\n";
|
||||
print "RCPT TO:".join(',',(map { "<$_>" } @recipients))."\n";
|
||||
} else {
|
||||
print "Sendmail: $smtp_server\n";
|
||||
print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
|
||||
}
|
||||
print "From: $from\nSubject: $subject\nCc: $cc\nTo: $to\n\n";
|
||||
if ($smtp) {
|
||||
@ -587,7 +611,6 @@ foreach my $t (@files) {
|
||||
$message = "From: $author_not_sender\n\n$message";
|
||||
}
|
||||
|
||||
$cc = join(", ", unique_email_list(@cc));
|
||||
|
||||
send_message();
|
||||
|
||||
|
19
git-svn.perl
19
git-svn.perl
@ -771,19 +771,19 @@ sub cmt_metadata {
|
||||
sub working_head_info {
|
||||
my ($head, $refs) = @_;
|
||||
my ($fh, $ctx) = command_output_pipe('rev-list', $head);
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my ($url, $rev, $uuid) = cmt_metadata($_);
|
||||
while (my $hash = <$fh>) {
|
||||
chomp($hash);
|
||||
my ($url, $rev, $uuid) = cmt_metadata($hash);
|
||||
if (defined $url && defined $rev) {
|
||||
if (my $gs = Git::SVN->find_by_url($url)) {
|
||||
my $c = $gs->rev_db_get($rev);
|
||||
if ($c && $c eq $_) {
|
||||
if ($c && $c eq $hash) {
|
||||
close $fh; # break the pipe
|
||||
return ($url, $rev, $uuid, $gs);
|
||||
}
|
||||
}
|
||||
}
|
||||
unshift @$refs, $_ if $refs;
|
||||
unshift @$refs, $hash if $refs;
|
||||
}
|
||||
command_close_pipe($fh, $ctx);
|
||||
(undef, undef, undef, undef);
|
||||
@ -1064,7 +1064,10 @@ sub init_remote_config {
|
||||
|
||||
sub find_by_url { # repos_root and, path are optional
|
||||
my ($class, $full_url, $repos_root, $path) = @_;
|
||||
|
||||
return undef unless defined $full_url;
|
||||
remove_username($full_url);
|
||||
remove_username($repos_root) if defined $repos_root;
|
||||
my $remotes = read_all_remotes();
|
||||
if (defined $full_url && defined $repos_root && !defined $path) {
|
||||
$path = $full_url;
|
||||
@ -1072,6 +1075,7 @@ sub find_by_url { # repos_root and, path are optional
|
||||
}
|
||||
foreach my $repo_id (keys %$remotes) {
|
||||
my $u = $remotes->{$repo_id}->{url} or next;
|
||||
remove_username($u);
|
||||
next if defined $repos_root && $repos_root ne $u;
|
||||
|
||||
my $fetch = $remotes->{$repo_id}->{fetch} || {};
|
||||
@ -1866,11 +1870,14 @@ sub make_log_entry {
|
||||
} elsif ($self->use_svnsync_props) {
|
||||
my $full_url = $self->svnsync->{url};
|
||||
$full_url .= "/$self->{path}" if length $self->{path};
|
||||
remove_username($full_url);
|
||||
my $uuid = $self->svnsync->{uuid};
|
||||
$log_entry{metadata} = "$full_url\@$rev $uuid";
|
||||
$email ||= "$author\@$uuid"
|
||||
} else {
|
||||
$log_entry{metadata} = $self->metadata_url. "\@$rev " .
|
||||
my $url = $self->metadata_url;
|
||||
remove_username($url);
|
||||
$log_entry{metadata} = "$url\@$rev " .
|
||||
$self->ra->get_uuid;
|
||||
$email ||= "$author\@" . $self->ra->get_uuid;
|
||||
}
|
||||
|
@ -86,12 +86,14 @@ Perl interface to Git
|
||||
|
||||
%build
|
||||
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_OWN_SUBPROCESS_PY=YesPlease \
|
||||
ETC_GITCONFIG=/etc/gitconfig \
|
||||
prefix=%{_prefix} all %{!?_without_docs: doc}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \
|
||||
WITH_OWN_SUBPROCESS_PY=YesPlease \
|
||||
ETC_GITCONFIG=/etc/gitconfig \
|
||||
prefix=%{_prefix} mandir=%{_mandir} INSTALLDIRS=vendor \
|
||||
install %{!?_without_docs: install-doc}
|
||||
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
|
||||
|
@ -13,7 +13,7 @@ my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');
|
||||
# We come with our own bundled Error.pm. It's not in the set of default
|
||||
# Perl modules so install it if it's not available on the system yet.
|
||||
eval { require Error };
|
||||
if ($@) {
|
||||
if ($@ || $Error::VERSION < 0.15009) {
|
||||
$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
|
||||
}
|
||||
|
||||
|
10
sha1_file.c
10
sha1_file.c
@ -516,7 +516,7 @@ static void scan_windows(struct packed_git *p,
|
||||
}
|
||||
}
|
||||
|
||||
static int unuse_one_window(struct packed_git *current)
|
||||
static int unuse_one_window(struct packed_git *current, int keep_fd)
|
||||
{
|
||||
struct packed_git *p, *lru_p = NULL;
|
||||
struct pack_window *lru_w = NULL, *lru_l = NULL;
|
||||
@ -532,7 +532,7 @@ static int unuse_one_window(struct packed_git *current)
|
||||
lru_l->next = lru_w->next;
|
||||
else {
|
||||
lru_p->windows = lru_w->next;
|
||||
if (!lru_p->windows && lru_p != current) {
|
||||
if (!lru_p->windows && lru_p->pack_fd != keep_fd) {
|
||||
close(lru_p->pack_fd);
|
||||
lru_p->pack_fd = -1;
|
||||
}
|
||||
@ -544,10 +544,10 @@ static int unuse_one_window(struct packed_git *current)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void release_pack_memory(size_t need)
|
||||
void release_pack_memory(size_t need, int fd)
|
||||
{
|
||||
size_t cur = pack_mapped;
|
||||
while (need >= (cur - pack_mapped) && unuse_one_window(NULL))
|
||||
while (need >= (cur - pack_mapped) && unuse_one_window(NULL, fd))
|
||||
; /* nothing */
|
||||
}
|
||||
|
||||
@ -680,7 +680,7 @@ unsigned char* use_pack(struct packed_git *p,
|
||||
win->len = (size_t)len;
|
||||
pack_mapped += win->len;
|
||||
while (packed_git_limit < pack_mapped
|
||||
&& unuse_one_window(p))
|
||||
&& unuse_one_window(p, p->pack_fd))
|
||||
; /* nothing */
|
||||
win->base = xmmap(NULL, win->len,
|
||||
PROT_READ, MAP_PRIVATE,
|
||||
|
@ -104,4 +104,10 @@ test_expect_success 'add ignored ones with -f' '
|
||||
git-ls-files --error-unmatch d.ig/d.if d.ig/d.ig
|
||||
'
|
||||
|
||||
mkdir 1 1/2 1/3
|
||||
touch 1/2/a 1/3/b 1/2/c
|
||||
test_expect_success 'check correct prefix detection' '
|
||||
git add 1/2/a 1/3/b 1/2/c
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user