1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 15:28:21 +01:00
Commit graph

30 commits

Author SHA1 Message Date
Huw Davies
262a6ef76a git-format-patch: Use rfc2822 compliant date.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-30 00:32:25 -07:00
Mark Wooding
f327dbced2 Shell utilities: Guard against expr' magic tokens.
Some words, e.g., `match', are special to expr(1), and cause strange
parsing effects.  Track down all uses of expr and mangle the arguments
so that this isn't a problem.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13 16:45:48 -07:00
Mike McCormack
19bb732728 Allow format-patch to attach patches
The --attach patch to git-format-patch to attach patches instead of
inlining them.  Some mailers linewrap inlined patches (eg. Mozilla).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-06 17:04:53 -08:00
Mike McCormack
00333ca35c Allow adding arbitary lines in the mail header generated by format-patch.
Entries may be added to the config file as follows:

[format]
         headers = "Organization: CodeWeavers\nTo: wine-patches
<wine-patches@winehq.org>\n"

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-06 17:04:07 -08:00
Alexandre Julliard
f891cb3fd6 git-format-patch: Always add a blank line between headers and body.
If the second line of the commit message isn't empty, git-format-patch
needs to add an empty line in order to generate a properly formatted
mail. Otherwise git-rebase drops the rest of the commit message.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-27 11:01:47 -08:00
Junio C Hamano
fab5de7936 format-patch: pretty-print timestamp correctly.
Perl is not C and does not truncate the division result.  Arghh!

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-21 18:13:32 -08:00
Andreas Ericsson
66f04f38f4 format-patch: Remove last vestiges of --mbox option
Don't mention it in docs or --help output.
Remove mbox, date and author variables from git-format-patch.sh.

Use DESCRIPTION text from man-page to update LONG_USAGE output. It's
a bit silly to have two texts saying the same thing in different words,
and I'm too lazy to update both.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-07 02:09:55 -08:00
Eric W. Biederman
fc5be4fdaa Fix git-format-patch -s to include a Signed-off-by: line...
In the last round of bug fixes the signed-off-by line was still be
generated but it was not including a signed-off-by line :(

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-25 15:10:35 -08:00
Junio C Hamano
36383a3df3 [PATCH] format-patch: always --mbox and show sane Date:
Make --mbox, --author, and --date options a no-op, and always
use --mbox output, and rewrite the commit log formatting in
Perl.  This makes it easier to output Date: header in RFC 2822
format, so do that as well.

Inspiration for this patch came from Andreas Ericsson's earlier
patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-14 17:21:34 -08:00
Yann Dirson
5f815e5922 Fix git-format-patch usage string wrt output modes.
--stdout was not mentionned, and the description for the case where -o
was not given was thus incomplete.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-07 18:17:38 -08:00
Junio C Hamano
aa66c7ec77 format-patch/commit: Quote single quote in the author name properly.
Noticed by Kyle McMartin.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:02:33 -08:00
Junio C Hamano
a5c21d6eb7 format-patch: make sure header and body are separated.
Since log message in a commit object is defined to be binary
blob, it could be something without an empty line between the
title line and the body text.  Be careful to format such into
a form suitable for e-mail submission.  There must be an empty
line between the headers and the body.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-19 21:55:12 -08:00
freku045@student.liu.se
806f36d4d7 Trivial usage string clean-up
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14 02:53:43 -08:00
Junio C Hamano
7564577a6c format-patch: use same number of digits in numbers
This would help sorting by subject in MUA work saner even though
MUA is too dumb to attempt sorting numbered subjects sanely.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-10 22:22:35 -08:00
Junio C Hamano
830273d10c format-patch: run diff in C locale
Otherwise it would show incomplete line and binary markers in
a locale dependent way.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:27:59 -08:00
Junio C Hamano
a004d3f70f format-patch: do not abuse 3-dash marker line.
Before GIT version at the end of output we used a 3-dash marker;
but 3-dash marker is special and should not be overused.
Instead, use "-- " which is a standard practice in e-mails to
signal the beginning of trailing garbage.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:26:48 -08:00
Junio C Hamano
99e368b996 format-patch: remove applies-to.
The attempt to help 3-way fallback by recording the tree object
id for the entire pre-image was unnecessary, and we already have
an better alternative in the form of per-blob "index" lines.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:25:00 -08:00
Junio C Hamano
51b3c00e9d format-patch: output filename reported to stdout verbatim.
Prepending asterisk to the output was just adding noise, and
making scripts like proposed git-send-mail by Andreas Ericsson
do unnecessary work.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-26 12:09:07 -08:00
Junio C Hamano
ae2b0f1518 git-sh-setup: die if outside git repository.
Now all the users of this script detect its exit status and die,
complaining that it is outside git repository.  So move the code
that dies from all callers to git-sh-setup script.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-25 13:49:17 -08:00
Junio C Hamano
88b5a74883 format-patch: fix two-argument special case, and make it easier to pick single commits
Luben Tuikov noticed that sometimes being able to say
'git-format-patch <commit>' to format the change a single commit
introduces relative to its parent is handy.

This patch does not support that directly, but it makes sense to
interpret a single argument "rev" to mean "rev^1..rev".

With this, the backward compatibility syntaxes still apply:

 - "format-patch master" means "format-patch master..HEAD"
 - "format-patch origin master" means "format-patch origin..master"
 - "format-patch origin.." means "format-patch origin..HEAD"

But "format-patch a b c d e" formats the changes these five
commits introduce relative to their respective parents.  Earlier
it rejected these arguments not in "one..two" form.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-21 12:21:24 -08:00
Junio C Hamano
e3e291fc07 Do not lose author name information to locale gotchas.
I noticed format-patch loses authorship information of Lukas' patch
when I run git tools with LC_LANG set to ja_JP.  It turns out that
the sed script to set environment variables were not working on his
name (encoded in UTF-8), which is unfortunate but technically correct.

Force sed invocation under C locale because we always want literal byte
semantics.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11 00:37:34 -08:00
Jon Loeliger
93d69d8691 Refactored merge options into separate merge-options.txt.
Refactored fetch options into separate fetch-options.txt.
Made git-merge use merge-options.
Made git-fetch use fetch-options.
Made git-pull use merge-options and fetch-options.
Added --help option to git-pull and git-format-patch scripts.
Rewrote Documentation/Makefile to dynamically determine
include dependencies.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-06 23:32:04 -08:00
Junio C Hamano
b748421aaa git-format-patch: silly typo fix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-06 00:21:45 -08:00
Junio C Hamano
bd7c8aab70 format-patch: "rev1.." should mean "rev1..HEAD"
"rev1.." should mean "rev1..HEAD"; git-diff users are familiar
with that syntax.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-05 02:48:29 -08:00
Junio C Hamano
603d874587 format-patch: take sequence of ranges.
This enhances set of revs you can give format-patch.

Originally, format-patch took either one rev, or two revs:

    format-patch rev1
    format-patch rev1 rev2

The first format was a short-hand for "format-patch rev1 HEAD"
(i.e. rev2==HEAD).  What this meant was to find commits that are
in branch rev2 that has not been merged to branch rev1.

The above notation is still supported, but now it takes sequence
of "from1..to1 from2..to2 ...".  In short, the second format has
become a short-hand for "format-patch rev1..rev2".  Commits in
to1 but not in from1, to2 but not in from2, ... are formatted as
emailable patches.

With this, cherry-picking from other branch can be written as:

    git-format-patch -k --stdout master..branch1 master..branch2 |
    git-am -k -3

which is generally faster than traditional cherry-pick (which
always did 3-way merge) if patches apply cleanly, and still
falls back on 3-way merge if some of them do not.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 23:18:46 -07:00
Junio C Hamano
655c7470e2 git-format-patch: --stdout option.
This new flag generates the mbox formatted output to the standard
output, instead of saving them into a file per patch and implies --mbox.

It also fixes a corner case where the commit does not have *any* message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-06 14:25:52 -07:00
Junio C Hamano
3ff8cbeda6 Record which tree the patch applies to.
Also note which version of GIT produced the patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-04 17:04:45 -07:00
Junio C Hamano
b10c1a74f0 Remove useless use of sed in git-format-patch.
There was a leftover use of sed that attempted to remove the commit ID
output from git-diff-tree, which turned into an expensive no-op when
git-diff-tree output header format changed about three months ago.
Drop it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-04 00:40:59 -07:00
Junio C Hamano
4a5b63e3e9 [PATCH] Omit patches that have already been merged from format-patch output.
This switches the logic to pick which commits to include in the output
from git-rev-list to git-cherry; as a side effect, 'format-patch ^up mine'
would stop working although up..mine would continue to work.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 19:15:02 -07:00
Junio C Hamano
215a7ad1ef Big tool rename.
As promised, this is the "big tool rename" patch.  The primary differences
since 0.99.6 are:

  (1) git-*-script are no more.  The commands installed do not
      have any such suffix so users do not have to remember if
      something is implemented as a shell script or not.

  (2) Many command names with 'cache' in them are renamed with
      'index' if that is what they mean.

There are backward compatibility symblic links so that you and
Porcelains can keep using the old names, but the backward
compatibility support  is expected to be removed in the near
future.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 17:45:20 -07:00
Renamed from git-format-patch-script (Browse further)