summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-18 00:41:43 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-18 00:41:43 -0700
commit148c63006a8e4985a9eee0863073588d8ac18a8a (patch)
treea96f5d802baa7ea8a7d36999871f10a37d16e025 /git-send-email.perl
parentacd69176f7ec54deac208e59ccfa079950ab7916 (diff)
parent7a461b5a33239cfba3bbf0a1deef544c7f1dcfeb (diff)
downloadgit-148c63006a8e4985a9eee0863073588d8ac18a8a.tar.gz
Merge branch 'maint'
* maint: Document ls-files --with-tree=<tree-ish> git-commit: partial commit of paths only removed from the index git-commit: Allow partial commit of file removal. send-email: make message-id generation a bit more robust git-gui: Disable native platform text selection in "lists" git-gui: Paper bag fix "Commit->Revert" format arguments git-gui: Provide 'uninstall' Makefile target to undo an installation git-gui: Font chooser to handle a large number of font families git-gui: Make backporting changes from i18n version easier git-gui: Don't delete send on Windows as it doesn't exist git-gui: Trim trailing slashes from untracked submodule names git-gui: Assume untracked directories are Git submodules git-gui: handle "deleted symlink" diff marker git-gui: show unstaged symlinks in diff viewer git-gui: Avoid use of libdir in Makefile git-gui: Disable Tk send in all git-gui sessions git-gui: lib/index.tcl: handle files with % in the filename properly git-gui: Properly set the state of "Stage/Unstage Hunk" action git-gui: Fix detaching current branch during checkout git-gui: Correct starting of git-remote to handle -w option
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl15
1 files changed, 11 insertions, 4 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index d8319d45fb..4031e86b86 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -478,10 +478,17 @@ sub extract_valid_address {
# We'll setup a template for the message id, using the "from" address:
+my ($message_id_stamp, $message_id_serial);
sub make_message_id
{
- my $date = time;
- my $pseudo_rand = int (rand(4200));
+ my $uniq;
+ if (!defined $message_id_stamp) {
+ $message_id_stamp = sprintf("%s-%s", time, $$);
+ $message_id_serial = 0;
+ }
+ $message_id_serial++;
+ $uniq = "$message_id_stamp-$message_id_serial";
+
my $du_part;
for ($sender, $repocommitter, $repoauthor) {
$du_part = extract_valid_address(sanitize_address($_));
@@ -491,8 +498,8 @@ sub make_message_id
use Sys::Hostname qw();
$du_part = 'user@' . Sys::Hostname::hostname();
}
- my $message_id_template = "<%s-git-send-email-$du_part>";
- $message_id = sprintf $message_id_template, "$date$pseudo_rand";
+ my $message_id_template = "<%s-git-send-email-%s>";
+ $message_id = sprintf($message_id_template, $uniq, $du_part);
#print "new message id = $message_id\n"; # Was useful for debugging
}