* Re: [PATCH 1/8] Docs: send-email's usage text and man page mention same options
From: Miklos Vajna @ 2008-09-28 5:08 UTC (permalink / raw)
To: Michael Witten; +Cc: gitster, git
In-Reply-To: <1222564196-84202-1-git-send-email-mfwitten@mit.edu>
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On Sat, Sep 27, 2008 at 08:09:49PM -0500, Michael Witten <mfwitten@MIT.EDU> wrote:
> Specifically, boolean options are now listed in the form
>
> --[no-]option
>
> and both forms of documentation now consistently use
>
> --[no-]signed-off-by-cc
I don't think documenting --no-foo in the perl script itself is a good
idea. See c3170a8 (git-merge: exclude unnecessary options from
OPTIONS_SPEC, 2008-05-12) which removes --no-foo from git-merge as well.
Of course the man page part makes sense.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* [PATCH] bash completion: Add --[no-]-validate to "git send-email"
From: Teemu Likonen @ 2008-09-28 4:51 UTC (permalink / raw)
To: Michael Witten; +Cc: gitster, git, spearce
In-Reply-To: <1222564196-84202-4-git-send-email-mfwitten@mit.edu>
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---
If your patch is to be applied let's also add the options to bash
completion.
contrib/completion/git-completion.bash | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 93f0881..7284c3b 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1141,7 +1141,8 @@ _git_send_email ()
--no-suppress-from --no-thread --quiet
--signed-off-by-cc --smtp-pass --smtp-server
--smtp-server-port --smtp-ssl --smtp-user --subject
- --suppress-cc --suppress-from --thread --to"
+ --suppress-cc --suppress-from --thread --to
+ --validate --no-validate"
return
;;
esac
--
1.6.0.2.371.g15dc6
^ permalink raw reply related
* Re: [PATCH] Implement a textconv filter for "git diff"
From: Jeff King @ 2008-09-28 4:15 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
In-Reply-To: <1222567618-22156-4-git-send-email-Matthieu.Moy@imag.fr>
On Sun, Sep 28, 2008 at 04:06:56AM +0200, Matthieu Moy wrote:
> +static int textconv_two_files(const char *textconv,
> + const char *name_a,
> + const char *name_b,
> + mmfile_t *mf1,
> + mmfile_t *mf2,
> + struct diff_filespec *one,
> + struct diff_filespec *two)
> +{
Must we always be textconv'ing two files? What if I am comparing
"v1.5:foo.odf" to "foo.txt" in the working tree?
In my implementation, I textconv one at a time. I just did so from
fill_mmfile, so all of diff automagically just sees the converted text.
-Peff
^ permalink raw reply
* Re: Implementation of a "textconv" filter for easy custom diff.
From: Jeff King @ 2008-09-28 4:10 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
In-Reply-To: <1222567618-22156-1-git-send-email-Matthieu.Moy@imag.fr>
On Sun, Sep 28, 2008 at 04:06:53AM +0200, Matthieu Moy wrote:
> This patch serie give an implementation of a "textconv" filter for
> "git diff", that allows one to diff anything that can easily be
> converted to text with just a few lines in ~/.gitconfig and
> .gitattributes.
>
> The really cool thing in comparison with GIT_EXTERNAL_DIFF is that one
> gets all the cool things of "git diff" (colors & cie) for free.
Neat. I started on something like this quite a while ago, and have been
meaning to clean it up for some time (and I somehow missed your other
prototype, too). I agree that it matches my goals much better: the
filters are easier to write, and you get the benefit of a nice colorized
diff (or even --color-words!).
We have one major difference in our approaches. In yours, there is a
new "textconv" attribute that can be used. In mine, I subtly changed the
meaning of the "diff=foo" attribute to be "use the diff driver named by
diff.foo.*", and you would set diff.foo.textconv to your command. This
is a bit simpler to implement, and it provides a better path forward for
defining sets of diff tweaks.
For example, one of the limitations of the current syntax is that you
can't say "Choose automatically whether this is binary or text, but if
it is text, use this hunk header." But with my scheme it is easy to do:
in attributes:
file diff=foo
in config:
[diff "foo"]
xfuncname = "some regex"
binary = auto
Is there a particular reason you chose the route you did?
-Peff
^ permalink raw reply
* Re: [PATCH 8/8] Docs: config: send-email config options included
From: Jeff King @ 2008-09-28 3:24 UTC (permalink / raw)
To: Michael Witten; +Cc: gitster, git
In-Reply-To: <1222564196-84202-8-git-send-email-mfwitten@mit.edu>
On Sat, Sep 27, 2008 at 08:09:56PM -0500, Michael Witten wrote:
> I just copied what is in the send-email man text.
NAK, this makes things much worse by creating two places which must be
updated with any changes. Shouldn't doing it the right way be as simple
as something like the patch below?
Though it looks like imap.* simply says "See git-imap-send(1)" in
config.txt, which would also be OK by me (and makes sense especially if
we drop most of the sendemail.* description in favor of just mentioning
the config option near the matching command-line option).
---
Documentation/config.txt | 2 +
Documentation/git-send-email.txt | 48 +-----------------------------------
Documentation/sendemail-config.txt | 47 +++++++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 47 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index c806749..0bb2621 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1173,6 +1173,8 @@ receive.denyNonFastForwards::
even if that push is forced. This configuration variable is
set when initializing a shared repository.
+include::sendemail-config.txt[]
+
transfer.unpackLimit::
When `fetch.unpackLimit` or `receive.unpackLimit` are
not set, the value of this variable is used instead.
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 3c3e1b0..465cf56 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -195,53 +195,7 @@ The --to option must be repeated for each user you want on the to list.
CONFIGURATION
-------------
-sendemail.identity::
- The default configuration identity. When specified,
- 'sendemail.<identity>.<item>' will have higher precedence than
- 'sendemail.<item>'. This is useful to declare multiple SMTP
- identities and to hoist sensitive authentication information
- out of the repository and into the global configuration file.
-
-sendemail.aliasesfile::
- To avoid typing long email addresses, point this to one or more
- email aliases files. You must also supply 'sendemail.aliasfiletype'.
-
-sendemail.aliasfiletype::
- Format of the file(s) specified in sendemail.aliasesfile. Must be
- one of 'mutt', 'mailrc', 'pine', or 'gnus'.
-
-sendemail.to::
- Email address (or alias) to always send to.
-
-sendemail.cccmd::
- Command to execute to generate per patch file specific "Cc:"s.
-
-sendemail.bcc::
- Email address (or alias) to always bcc.
-
-sendemail.chainreplyto::
- Boolean value specifying the default to the '--chain_reply_to'
- parameter.
-
-sendemail.smtpserver::
- Default SMTP server to use.
-
-sendemail.smtpserverport::
- Default SMTP server port to use.
-
-sendemail.smtpuser::
- Default SMTP-AUTH username.
-
-sendemail.smtppass::
- Default SMTP-AUTH password.
-
-sendemail.smtpencryption::
- Default encryption method. Use 'ssl' for SSL (and specify an
- appropriate port), or 'tls' for TLS. Takes precedence over
- 'smtpssl' if both are specified.
-
-sendemail.smtpssl::
- Legacy boolean that sets 'smtpencryption=ssl' if enabled.
+include::sendemail-config.txt[]
Author
------
diff --git a/Documentation/sendemail-config.txt b/Documentation/sendemail-config.txt
new file mode 100644
index 0000000..7409534
--- /dev/null
+++ b/Documentation/sendemail-config.txt
@@ -0,0 +1,47 @@
+sendemail.identity::
+ The default configuration identity. When specified,
+ 'sendemail.<identity>.<item>' will have higher precedence than
+ 'sendemail.<item>'. This is useful to declare multiple SMTP
+ identities and to hoist sensitive authentication information
+ out of the repository and into the global configuration file.
+
+sendemail.aliasesfile::
+ To avoid typing long email addresses, point this to one or more
+ email aliases files. You must also supply 'sendemail.aliasfiletype'.
+
+sendemail.aliasfiletype::
+ Format of the file(s) specified in sendemail.aliasesfile. Must be
+ one of 'mutt', 'mailrc', 'pine', or 'gnus'.
+
+sendemail.to::
+ Email address (or alias) to always send to.
+
+sendemail.cccmd::
+ Command to execute to generate per patch file specific "Cc:"s.
+
+sendemail.bcc::
+ Email address (or alias) to always bcc.
+
+sendemail.chainreplyto::
+ Boolean value specifying the default to the '--chain_reply_to'
+ parameter.
+
+sendemail.smtpserver::
+ Default SMTP server to use.
+
+sendemail.smtpserverport::
+ Default SMTP server port to use.
+
+sendemail.smtpuser::
+ Default SMTP-AUTH username.
+
+sendemail.smtppass::
+ Default SMTP-AUTH password.
+
+sendemail.smtpencryption::
+ Default encryption method. Use 'ssl' for SSL (and specify an
+ appropriate port), or 'tls' for TLS. Takes precedence over
+ 'smtpssl' if both are specified.
+
+sendemail.smtpssl::
+ Legacy boolean that sets 'smtpencryption=ssl' if enabled.
^ permalink raw reply related
* Re: [PATCH 7/8] Docs: send-email: Added all config variables to man end
From: Jeff King @ 2008-09-28 3:18 UTC (permalink / raw)
To: Michael Witten; +Cc: gitster, git
In-Reply-To: <1222564196-84202-7-git-send-email-mfwitten@mit.edu>
On Sat, Sep 27, 2008 at 08:09:55PM -0500, Michael Witten wrote:
> Admittedly, I didn't take much pride in my work, but
> I'm not trying to solve this problem.
Remember that your commit message is supposed to be convincing us that
your patch is worth applying. ;P
It seems like these are just mechanical "sendemail.foo is a default for
--foo" additions. Maybe it is better to simply make a note of that (or
mention it in the --foo section).
-Peff
^ permalink raw reply
* Re: [PATCH 6/8] Docs: Arranged config options in man page
From: Jeff King @ 2008-09-28 3:15 UTC (permalink / raw)
To: Michael Witten; +Cc: gitster, git
In-Reply-To: <1222564196-84202-6-git-send-email-mfwitten@mit.edu>
On Sat, Sep 27, 2008 at 08:09:54PM -0500, Michael Witten wrote:
> Signed-off-by: Michael Witten <mfwitten@mit.edu>
> ---
Arranged in what way? I assume alphabetized, but please make it clear
in the commit message.
Also, Junio is out of touch for a few weeks, so it probably makes sense
to send your patches to Shawn Pearce <spearce@spearce.org> in the
interim.
Also also, micronit: we usually use the imperative to describe patch
changes (i.e., "arrange" instead of "arranged").
-Peff
^ permalink raw reply
* [PATCH] Facility to have multiple kinds of drivers for diff.
From: Matthieu Moy @ 2008-09-28 2:06 UTC (permalink / raw)
To: git; +Cc: Matthieu Moy
In-Reply-To: <1222567618-22156-1-git-send-email-Matthieu.Moy@imag.fr>
We now have an array attr_cmd_specs describing the possible kinds of
drivers.
---
diff.c | 63 +++++++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 41 insertions(+), 22 deletions(-)
diff --git a/diff.c b/diff.c
index 099ce3f..1c8dd19 100644
--- a/diff.c
+++ b/diff.c
@@ -56,11 +56,29 @@ static int parse_diff_color_slot(const char *var, int ofs)
die("bad config variable '%s'", var);
}
-static struct ll_cmd_driver {
+struct ll_cmd_driver {
const char *name;
struct ll_cmd_driver *next;
const char *cmd;
-} *user_diff, **user_diff_tail;
+};
+
+struct attr_cmd_spec {
+ char * name;
+ struct git_attr * attr_cmd;
+ struct ll_cmd_driver *head;
+ struct ll_cmd_driver **tail;
+};
+
+enum driver_indices {
+ DIFF_DRIVER=0,
+ TEXTCONV_DRIVER=1,
+ DRIVER_COUNT,
+};
+
+static struct attr_cmd_spec attr_cmd_specs[DRIVER_COUNT] = {
+ {"diff", NULL},
+ {"textconv", NULL},
+};
/*
* Currently there is only "diff.<drivername>.command" variable;
@@ -68,24 +86,24 @@ static struct ll_cmd_driver {
* this in a bit convoluted way to allow low level diff driver
* called "color".
*/
-static int parse_ll_command(const char *var, const char *ep, const char *value)
+static int parse_ll_command(const char *var, const char *name,
+ const char *ep, const char *value,
+ int driver)
{
- const char *name;
int namelen;
struct ll_cmd_driver *drv;
- name = var + 5;
namelen = ep - name;
- for (drv = user_diff; drv; drv = drv->next)
+ for (drv = attr_cmd_specs[driver].head; drv; drv = drv->next)
if (!strncmp(drv->name, name, namelen) && !drv->name[namelen])
break;
if (!drv) {
drv = xcalloc(1, sizeof(struct ll_cmd_driver));
drv->name = xmemdupz(name, namelen);
- if (!user_diff_tail)
- user_diff_tail = &user_diff;
- *user_diff_tail = drv;
- user_diff_tail = &(drv->next);
+ if (!attr_cmd_specs[driver].tail)
+ attr_cmd_specs[driver].tail = &attr_cmd_specs[driver].head;
+ *attr_cmd_specs[driver].tail = drv;
+ attr_cmd_specs[driver].tail = &(drv->next);
}
return git_config_string(&(drv->cmd), var, value);
@@ -161,7 +179,7 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
const char *ep = strrchr(var, '.');
if (ep != var + 4 && !strcmp(ep, ".command"))
- return parse_ll_command(var, ep, value);
+ return parse_ll_command(var, var + 5, ep, value, DIFF_DRIVER);
}
return git_diff_basic_config(var, value, cb);
@@ -1340,14 +1358,14 @@ static void emit_binary_diff(FILE *file, mmfile_t *one, mmfile_t *two)
emit_binary_diff_body(file, two, one);
}
-static void setup_diff_attr_check(struct git_attr_check *check)
+/* driver_index must be among the values of "enum driver_indices" */
+static void setup_cmd_attr_check(struct git_attr_check *check, int driver_index)
{
- static struct git_attr *attr_diff;
-
- if (!attr_diff) {
- attr_diff = git_attr("diff", 4);
+ struct attr_cmd_spec * spec = &attr_cmd_specs[driver_index];
+ if (!spec->attr_cmd) {
+ spec->attr_cmd = git_attr(spec->name, strlen(spec->name));
}
- check[0].attr = attr_diff;
+ check[0].attr = spec->attr_cmd;
}
static void diff_filespec_check_attr(struct diff_filespec *one)
@@ -1358,7 +1376,7 @@ static void diff_filespec_check_attr(struct diff_filespec *one)
if (one->checked_attr)
return;
- setup_cmd_attr_check(&attr_cmd_check);
+ setup_cmd_attr_check(&attr_cmd_check, DIFF_DRIVER);
one->is_binary = 0;
one->funcname_pattern_ident = NULL;
@@ -2092,14 +2110,14 @@ static void run_external_diff(const char *pgm,
}
}
-static const char *external_cmd_attr(const char *name)
+static const char *external_cmd_attr(const char *name, int driver_index)
{
struct git_attr_check attr_cmd_check;
if (!name)
return NULL;
- setup_diff_attr_check(&attr_cmd_check);
+ setup_cmd_attr_check(&attr_cmd_check, driver_index);
if (!git_checkattr(name, 1, &attr_cmd_check)) {
const char *value = attr_cmd_check.value;
if (!ATTR_TRUE(value) &&
@@ -2107,7 +2125,8 @@ static const char *external_cmd_attr(const char *name)
!ATTR_UNSET(value)) {
struct ll_cmd_driver *drv;
- for (drv = user_diff; drv; drv = drv->next)
+ for (drv = attr_cmd_specs[driver_index].head;
+ drv; drv = drv->next)
if (!strcmp(drv->name, value))
return drv->cmd;
}
@@ -2128,7 +2147,7 @@ static void run_diff_cmd(const char *pgm,
if (!DIFF_OPT_TST(o, ALLOW_EXTERNAL))
pgm = NULL;
else {
- const char *cmd = external_cmd_attr(attr_path);
+ const char *cmd = external_cmd_attr(attr_path, DIFF_DRIVER);
if (cmd)
pgm = cmd;
}
--
1.6.0.2.312.g1ef81a
^ permalink raw reply related
* [PATCH] Implement a textconv filter for "git diff"
From: Matthieu Moy @ 2008-09-28 2:06 UTC (permalink / raw)
To: git; +Cc: Matthieu Moy
In-Reply-To: <1222567618-22156-3-git-send-email-Matthieu.Moy@imag.fr>
That feature is similar to the custom diff driver, but the user only has
to provide a text filter (a command to convert a file into a plain-text
representation). Git takes care of diffing, mode change, ...
For example, with
[textconv "odt2txt"]
command=odt2txt
*.ods textconv=odt2txt
*.odp textconv=odt2txt
*.odt textconv=odt2txt
One can use "git diff" on OpenOffice files (including "git diff --color"
and friends).
This could be extended so that "git blame" can use it also.
---
diff.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 6917981..7cbc42b 100644
--- a/diff.c
+++ b/diff.c
@@ -181,6 +181,12 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
if (ep != var + 4 && !strcmp(ep, ".command"))
return parse_ll_command(var, var + 5, ep, value, DIFF_DRIVER);
}
+ if (!prefixcmp(var, "textconv.")) {
+ const char *ep = strrchr(var, '.');
+
+ if (ep != var + 8 && !strcmp(ep, ".command"))
+ return parse_ll_command(var, var + 9, ep, value, TEXTCONV_DRIVER);
+ }
return git_diff_basic_config(var, value, cb);
}
@@ -262,6 +268,10 @@ static struct diff_tempfile {
/* Forward declarations */
static int run_command_to_buf(const char **argv, char **buf, size_t * size);
+static const char *external_cmd_attr(const char *name, int driver_index);
+static void prepare_temp_file(const char *name,
+ struct diff_tempfile *temp,
+ struct diff_filespec *one);
/* End forward declarations */
static int count_lines(const char *data, int size)
@@ -1511,6 +1521,52 @@ static int run_command_to_buf(const char **argv, char **buf, size_t * size)
return 0;
}
+static int textconv_two_files(const char *textconv,
+ const char *name_a,
+ const char *name_b,
+ mmfile_t *mf1,
+ mmfile_t *mf2,
+ struct diff_filespec *one,
+ struct diff_filespec *two)
+{
+ const char *spawn_arg[3];
+ const char **arg = &spawn_arg[0];
+ struct diff_tempfile *temp = diff_temp;
+ char *buf_a, *buf_b;
+ size_t size_a, size_b;
+ prepare_temp_file(name_a, &temp[0], one);
+ *arg++ = textconv;
+ *arg++ = temp[0].name;
+ *arg++ = NULL;
+ /*
+ * Run both commands before touching arguments to make sure we
+ * do all or nothing.
+ */
+ if(run_command_to_buf(spawn_arg, &buf_a, &size_a))
+ return -1;
+
+ prepare_temp_file(name_b, &temp[1], two);
+ spawn_arg[1] = temp[1].name;
+ if(run_command_to_buf(spawn_arg, &buf_b, &size_b))
+ return -1;
+
+ mf1->ptr = buf_a;
+ mf1->size = (long)size_a;
+ one->data = mf1->ptr;
+ one->size = mf1->size;
+ one->should_free = 1;
+ one->should_munmap = 1;
+
+ mf2->ptr = buf_b;
+ mf2->size = (long)size_b;
+ two->data = mf2->ptr;
+ two->size = mf2->size;
+ two->should_free = 1;
+ two->should_munmap = 1;
+ return 0;
+}
+
+
static void builtin_diff(const char *name_a,
const char *name_b,
struct diff_filespec *one,
@@ -1574,6 +1630,18 @@ static void builtin_diff(const char *name_a,
if (fill_mmfile(&mf1, one) < 0 || fill_mmfile(&mf2, two) < 0)
die("unable to read files to diff");
+ const char * textconv = external_cmd_attr(name_a, TEXTCONV_DRIVER);
+ const char * textconvb = external_cmd_attr(name_b, TEXTCONV_DRIVER);
+
+ /*
+ * Only use the textconv driver if it is set, and is the same
+ * for source and destination file.
+ */
+ if (textconv && textconvb && !strcmp(textconv, textconvb))
+ if(textconv_two_files(textconv, name_a, name_b, &mf1, &mf2, one, two))
+ fprintf(stderr, "warning: textconv filter failed, "
+ "falling back to plain diff\n");
+
if (!DIFF_OPT_TST(o, TEXT) &&
(diff_filespec_is_binary(one) || diff_filespec_is_binary(two))) {
/* Quite common confusing case */
--
1.6.0.2.312.g1ef81a
^ permalink raw reply related
* [PATCH] Document the textconv filter.
From: Matthieu Moy @ 2008-09-28 2:06 UTC (permalink / raw)
To: git; +Cc: Matthieu Moy
In-Reply-To: <1222567618-22156-4-git-send-email-Matthieu.Moy@imag.fr>
---
Documentation/gitattributes.txt | 43 +++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index e848c94..c4f2b8f 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -325,6 +325,49 @@ patterns are available:
- `tex` suitable for source code for LaTeX documents.
+Converting files to text before a diff
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The attribute `textconv` affects 'git diff' in a way similar to the
+`diff` attribute, but with `textconv`, the user provides only a way to
+convert the file into text, and git takes care of doing the diff as
+usual (i.e. other options of 'git diff' such as '--color' remain
+available).
+
+The value of `textconv` must be a string, which is the textconv
+driver.
+
+To tell git to use the `exif` filter for jpeg images, use:
+
+----------------------------------------------------------------
+*.jpg textconv=exif
+----------------------------------------------------------------
+
+Defining a custom textconv driver
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The definition of the `textconv` driver is done in `gitconfig`. To
+define a driver `exif`, add this to your `$GIT_DIR/config` file (or
+`$HOME/.gitconfig` file):
+
+----------------------------------------------------------------
+[textconv "exif"]
+ command = exiftags
+----------------------------------------------------------------
+
+Git will call the command specified in `command` with the file to
+convert as only argument. The program should write the text on its
+standard output.
+
+Examples of useful filters include:
+
+----------------------------------------------------------------
+[textconv "odt2txt"]
+ command = odt2txt
+[textconv "word"]
+ command = catdoc
+----------------------------------------------------------------
+
Performing a three-way merge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.6.0.2.312.g1ef81a
^ permalink raw reply related
* [PATCH] Implement run_command_to_buf (spawn a process and reads its stdout)
From: Matthieu Moy @ 2008-09-28 2:06 UTC (permalink / raw)
To: git; +Cc: Matthieu Moy
In-Reply-To: <1222567618-22156-2-git-send-email-Matthieu.Moy@imag.fr>
---
diff.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 1c8dd19..6917981 100644
--- a/diff.c
+++ b/diff.c
@@ -260,6 +260,10 @@ static struct diff_tempfile {
char tmp_path[PATH_MAX];
} diff_temp[2];
+/* Forward declarations */
+static int run_command_to_buf(const char **argv, char **buf, size_t * size);
+/* End forward declarations */
+
static int count_lines(const char *data, int size)
{
int count, ch, completely_empty = 1, nl_just_seen = 0;
@@ -1487,6 +1491,26 @@ void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const
options->b_prefix = b;
}
+static int run_command_to_buf(const char **argv, char **buf, size_t * size)
+{
+ struct child_process cmd;
+ struct strbuf buffer = STRBUF_INIT;
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.argv = argv;
+ cmd.out = -1;
+
+ if (start_command(&cmd))
+ return -1;
+ strbuf_read(&buffer, cmd.out, 1024);
+ close(cmd.out);
+
+ if (finish_command(&cmd))
+ return -1;
+
+ *buf = strbuf_detach(&buffer, size);
+ return 0;
+}
+
static void builtin_diff(const char *name_a,
const char *name_b,
struct diff_filespec *one,
--
1.6.0.2.312.g1ef81a
^ permalink raw reply related
* [PATCH] Add a basic test for the textconv filter.
From: Matthieu Moy @ 2008-09-28 2:06 UTC (permalink / raw)
To: git; +Cc: Matthieu Moy
In-Reply-To: <1222567618-22156-5-git-send-email-Matthieu.Moy@imag.fr>
---
t/t4020-diff-external.sh | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index dfe3fbc..cf99912 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -99,6 +99,13 @@ test_expect_success 'no diff with -diff' '
git diff | grep Binary
'
+test_expect_success 'textconv attribute' '
+ git config textconv.echo.command echo
+ echo >.gitattributes "file textconv=echo"
+
+ git diff | grep "^+file$"
+'
+
echo NULZbetweenZwords | perl -pe 'y/Z/\000/' > file
test_expect_success 'force diff with "diff"' '
--
1.6.0.2.312.g1ef81a
^ permalink raw reply related
* Implementation of a "textconv" filter for easy custom diff.
From: Matthieu Moy @ 2008-09-28 2:06 UTC (permalink / raw)
To: git
This patch serie give an implementation of a "textconv" filter for
"git diff", that allows one to diff anything that can easily be
converted to text with just a few lines in ~/.gitconfig and
.gitattributes.
The really cool thing in comparison with GIT_EXTERNAL_DIFF is that one
gets all the cool things of "git diff" (colors & cie) for free.
I had already posted a prototype of this a long time back[1], but I
finally got time to clean up the code a bit.
http://article.gmane.org/gmane.comp.version-control.git/56896
^ permalink raw reply
* [PATCH 1/8] Docs: send-email's usage text and man page mention same options
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
Specifically, boolean options are now listed in the form
--[no-]option
and both forms of documentation now consistently use
--[no-]signed-off-by-cc
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Documentation/git-send-email.txt | 21 +++++++++++++--------
git-send-email.perl | 8 ++++----
2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 3c3e1b0..9b31626 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -40,8 +40,7 @@ The --cc option must be repeated for each user you want on the cc list.
Output of this command must be single email address per line.
Default is the value of 'sendemail.cccmd' configuration value.
---chain-reply-to::
---no-chain-reply-to::
+--[no-]chain-reply-to::
If this is set, each email will be sent as a reply to the previous
email sent. If disabled with "--no-chain-reply-to", all emails after
the first will be sent as replies to the first email sent. When using
@@ -66,8 +65,7 @@ The --cc option must be repeated for each user you want on the cc list.
Only necessary if --compose is also set. If --compose
is not set, this will be prompted for.
---signed-off-by-cc::
---no-signed-off-by-cc::
+--[no-]signed-off-by-cc::
If this is set, add emails found in Signed-off-by: or Cc: lines to the
cc list.
Default is the value of 'sendemail.signedoffcc' configuration value;
@@ -146,8 +144,7 @@ user is prompted for a password while the input is masked for privacy.
Only necessary if --compose is also set. If --compose
is not set, this will be prompted for.
---suppress-from::
---no-suppress-from::
+--[no-]suppress-from::
If this is set, do not add the From: address to the cc: list.
Default is the value of 'sendemail.suppressfrom' configuration value;
if that is unspecified, default to --no-suppress-from.
@@ -163,8 +160,7 @@ user is prompted for a password while the input is masked for privacy.
if that is unspecified, default to 'self' if --suppress-from is
specified, as well as 'sob' if --no-signed-off-cc is specified.
---thread::
---no-thread::
+--[no-]thread::
If this is set, the In-Reply-To header will be set on each email sent.
If disabled with "--no-thread", no emails will have the In-Reply-To
header set.
@@ -183,6 +179,15 @@ user is prompted for a password while the input is masked for privacy.
variable; if that is unspecified, choosing the envelope sender is left
to your MTA.
+--no-validate::
+ Don't perform any sanity checks on patches.
+ Currently, validation means the following:
++
+--
+ * Warn of patches that contain lines longer than 998 characters; this
+ is due to SMTP limits as described by http://www.ietf.org/rfc/rfc2821.txt.
+--
+
--to::
Specify the primary recipient of the emails generated.
Generally, this will be the upstream maintainer of the
diff --git a/git-send-email.perl b/git-send-email.perl
index d2fd899..9f56162 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -64,11 +64,11 @@ Options:
Only used if --compose is also set. If --compose is not
set, this will be prompted for.
- --chain-reply-to If set, the replies will all be to the previous
+ --[no-]chain-reply-to If set, the replies will all be to the previous
email sent, rather than to the first email sent.
Defaults to on.
- --signed-off-cc Automatically add email addresses that appear in
+ --[no-]signed-off-by-cc Automatically add email addresses that appear in
Signed-off-by: or Cc: lines to the cc: list. Defaults to on.
--identity The configuration identity, a subsection to prioritise over
@@ -95,9 +95,9 @@ Options:
'cccmd' for the output of the cccmd, or 'all' to suppress
all of these.
- --suppress-from Suppress sending emails to yourself. Defaults to off.
+ --[no-]suppress-from Suppress sending emails to yourself. Defaults to off.
- --thread Specify that the "In-Reply-To:" header should be set on all
+ --[no-]thread Specify that the "In-Reply-To:" header should be set on all
emails. Defaults to on.
--quiet Make git-send-email less verbose. One line per email
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH 8/8] Docs: config: send-email config options included
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1222564196-84202-7-git-send-email-mfwitten@mit.edu>
I just copied what is in the send-email man text.
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Documentation/config.txt | 69 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index bea867d..3fc1bb1 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1075,6 +1075,75 @@ repack.usedeltabaseoffset::
"false" and repack. Access from old git versions over the
native protocol are unaffected by this option.
+sendemail.aliasesfile::
+ To avoid typing long email addresses, point this to one or more
+ email aliases files. You must also supply 'sendemail.aliasfiletype'.
+
+sendemail.aliasfiletype::
+ Format of the file(s) specified in sendemail.aliasesfile. Must be
+ one of 'mutt', 'mailrc', 'pine', or 'gnus'.
+
+sendemail.bcc::
+ Email address (or alias) to always bcc.
+
+sendemail.cc::
+ Default for --cc
+
+sendemail.cccmd::
+ Command to execute to generate per patch file specific "Cc:"s.
+
+sendemail.chainreplyto::
+ Boolean value specifying the default to the '--[no-]chain-reply-to'
+ parameter.
+
+sendemail.envelopesender
+ Default for --envelope-sender.
+
+sendemail.identity::
+ The default configuration identity. When specified,
+ 'sendemail.<identity>.<item>' will have higher precedence than
+ 'sendemail.<item>'. This is useful to declare multiple SMTP
+ identities and to hoist sensitive authentication information
+ out of the repository and into the global configuration file.
+
+sendemail.signedoffcc::
+ Default for --[no-]signed-off-by-cc.
+
+sendemail.smtpencryption::
+ Default encryption method. Use 'ssl' for SSL (and specify an
+ appropriate port), or 'tls' for TLS. Takes precedence over
+ 'smtpssl' if both are specified.
+
+sendemail.smtppass::
+ Default SMTP-AUTH password.
+
+sendemail.smtpserver::
+ Default SMTP server to use.
+
+sendemail.smtpserverport::
+ Default SMTP server port to use.
+
+sendemail.smtpssl::
+ Legacy boolean that sets 'smtpencryption=ssl' if enabled.
+
+sendemail.smtpuser::
+ Default SMTP-AUTH username.
+
+sendemail.suppresscc::
+ Default for --supress-cc.
+
+sendemail.suppressfrom::
+ Default for --[no-]suppress-from
+
+sendemail.thread::
+ Default for --[no-]thread
+
+sendemail.to::
+ Email address (or alias) to always send to.
+
+sendemail.validate::
+ Boolean override for --[no-]validate.
+
showbranch.default::
The default set of branches for linkgit:git-show-branch[1].
See linkgit:git-show-branch[1].
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH 4/8] send-email: change --no-validate to boolean --[no-]validate
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1222564196-84202-3-git-send-email-mfwitten@mit.edu>
There is also now a configuration variable:
sendemail[.<identity>].validate
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Documentation/git-send-email.txt | 9 +++++++--
git-send-email.perl | 9 +++++----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 0c6dbf6..81970f3 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -182,14 +182,16 @@ configuration variable), then authentication is not attempted.
+
The --to option must be repeated for each user you want on the to list.
---no-validate::
- Don't perform any sanity checks on patches.
+--[no-]validate::
+ Perform sanity checks on patches.
Currently, validation means the following:
+
--
* Warn of patches that contain lines longer than 998 characters; this
is due to SMTP limits as described by http://www.ietf.org/rfc/rfc2821.txt.
--
++
+This option can be set with sendemail[.<identity>].validate; default to --validate
CONFIGURATION
@@ -242,6 +244,9 @@ sendemail.smtpencryption::
sendemail.smtpssl::
Legacy boolean that sets 'smtpencryption=ssl' if enabled.
+sendemail.validate::
+ Boolean override for --[no-]validate.
+
Author
------
Written by Ryan Anderson <ryan@michonline.com>
diff --git a/git-send-email.perl b/git-send-email.perl
index 2c31a25..3467cf1 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -65,7 +65,7 @@ Options:
--smtp-ssl * Deprecated. Use '--smtp-encryption ssl'.
--quiet * Output one line of info per email.
--dry-run * Don't actually send the emails.
- --no-validate * Don't perform sanity checks on patches.
+ --[no-]validate * Perform patch sanity checks. Default on.
EOT
exit(1);
@@ -147,7 +147,7 @@ my ($quiet, $dry_run) = (0, 0);
my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);
my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);
my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
-my ($no_validate);
+my ($validate);
my (@suppress_cc);
my %config_bool_settings = (
@@ -155,6 +155,7 @@ my %config_bool_settings = (
"chainreplyto" => [\$chain_reply_to, 1],
"suppressfrom" => [\$suppress_from, undef],
"signedoffcc" => [\$signed_off_cc, undef],
+ "validate" => [\$validate, 1],
);
my %config_settings = (
@@ -221,7 +222,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
"dry-run" => \$dry_run,
"envelope-sender=s" => \$envelope_sender,
"thread!" => \$thread,
- "no-validate" => \$no_validate,
+ "validate!" => \$validate,
);
unless ($rc) {
@@ -374,7 +375,7 @@ for my $f (@ARGV) {
}
}
-if (!$no_validate) {
+if ($validate) {
foreach my $f (@files) {
unless (-p $f) {
my $error = validate_patch($f);
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH 2/8] Docs: send-email usage text much sexier
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1222564196-84202-1-git-send-email-mfwitten@mit.edu>
All of the descriptions are aligned, shorter,
better arranged, and no line is greater than
78 columns.
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
git-send-email.perl | 94 ++++++++++++++-------------------------------------
1 files changed, 26 insertions(+), 68 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 9f56162..2c31a25 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -40,74 +40,32 @@ sub usage {
print <<EOT;
git send-email [options] <file | directory>...
Options:
- --from Specify the "From:" line of the email to be sent.
-
- --to Specify the primary "To:" line of the email.
-
- --cc Specify an initial "Cc:" list for the entire series
- of emails.
-
- --cc-cmd Specify a command to execute per file which adds
- per file specific cc address entries
-
- --bcc Specify a list of email addresses that should be Bcc:
- on all the emails.
-
- --compose Use \$GIT_EDITOR, core.editor, \$EDITOR, or \$VISUAL to edit
- an introductory message for the patch series.
-
- --subject Specify the initial "Subject:" line.
- Only necessary if --compose is also set. If --compose
- is not set, this will be prompted for.
-
- --in-reply-to Specify the first "In-Reply-To:" header line.
- Only used if --compose is also set. If --compose is not
- set, this will be prompted for.
-
- --[no-]chain-reply-to If set, the replies will all be to the previous
- email sent, rather than to the first email sent.
- Defaults to on.
-
- --[no-]signed-off-by-cc Automatically add email addresses that appear in
- Signed-off-by: or Cc: lines to the cc: list. Defaults to on.
-
- --identity The configuration identity, a subsection to prioritise over
- the default section.
-
- --smtp-server If set, specifies the outgoing SMTP server to use.
- Defaults to localhost. Port number can be specified here with
- hostname:port format or by using --smtp-server-port option.
-
- --smtp-server-port Specify a port on the outgoing SMTP server to connect to.
-
- --smtp-user The username for SMTP-AUTH.
-
- --smtp-pass The password for SMTP-AUTH.
-
- --smtp-encryption Specify 'tls' for STARTTLS encryption, or 'ssl' for SSL.
- Any other value disables the feature.
-
- --smtp-ssl Synonym for '--smtp-encryption=ssl'. Deprecated.
-
- --suppress-cc Suppress the specified category of auto-CC. The category
- can be one of 'author' for the patch author, 'self' to
- avoid copying yourself, 'sob' for Signed-off-by lines,
- 'cccmd' for the output of the cccmd, or 'all' to suppress
- all of these.
-
- --[no-]suppress-from Suppress sending emails to yourself. Defaults to off.
-
- --[no-]thread Specify that the "In-Reply-To:" header should be set on all
- emails. Defaults to on.
-
- --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.
-
- --no-validate Don't perform any sanity checks on patches.
+ --identity <str> * Use the sendemail.<id> options.
+ --from <str> * Email From:
+ --envelope-sender <str> * Email envelope sender.
+ --to <str> * Email To:
+ --cc <str> * Email Cc:
+ --cc-cmd <str> * Email Cc: via `<str> \$patch_path`
+ --bcc <str> * Email Bcc:
+ --subject <str> * Email "Subject:" (only if --compose).
+ --compose * Open an editor for introduction.
+ --in-reply-to <str> * First "In-Reply-To:" (only if --compose).
+ --[no-]chain-reply-to * Chain In-Reply-To: fields. Default on.
+ --[no-]thread * Use In-Reply-To: field. Default on.
+ --[no-]signed-off-by-cc * Actually send to Cc: and Signed-off-by:
+ addresses. Default on.
+ --suppress-cc <str> * author, self, sob, cccmd, all.
+ --[no-]suppress-from * Don't send email to self. Default off.
+ --smtp-server <str:int> * Outgoing SMTP server to use. The port
+ is optional. Default 'localhost'.
+ --smtp-server-port <int> * Outgoing SMTP server port.
+ --smtp-user <str> * The username for SMTP-AUTH.
+ --smtp-pass <str> * The password for SMTP-AUTH; not necessary.
+ --smtp-encryption <str> * tls or ssl; anything else disables.
+ --smtp-ssl * Deprecated. Use '--smtp-encryption ssl'.
+ --quiet * Output one line of info per email.
+ --dry-run * Don't actually send the emails.
+ --no-validate * Don't perform sanity checks on patches.
EOT
exit(1);
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH 5/8] Docs: send-email: --chain_reply_to -> --[no-]chain-reply-to
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1222564196-84202-4-git-send-email-mfwitten@mit.edu>
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Documentation/git-send-email.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 81970f3..6b62032 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -221,7 +221,7 @@ sendemail.bcc::
Email address (or alias) to always bcc.
sendemail.chainreplyto::
- Boolean value specifying the default to the '--chain_reply_to'
+ Boolean value specifying the default to the '--[no-]chain-reply-to'
parameter.
sendemail.smtpserver::
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH 7/8] Docs: send-email: Added all config variables to man end
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1222564196-84202-6-git-send-email-mfwitten@mit.edu>
Admittedly, I didn't take much pride in my work, but
I'm not trying to solve this problem.
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Documentation/git-send-email.txt | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 8aa5098..ee89e03 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -207,6 +207,9 @@ sendemail.aliasfiletype::
sendemail.bcc::
Email address (or alias) to always bcc.
+sendemail.cc::
+ Default for --cc
+
sendemail.cccmd::
Command to execute to generate per patch file specific "Cc:"s.
@@ -214,6 +217,9 @@ sendemail.chainreplyto::
Boolean value specifying the default to the '--[no-]chain-reply-to'
parameter.
+sendemail.envelopesender
+ Default for --envelope-sender.
+
sendemail.identity::
The default configuration identity. When specified,
'sendemail.<identity>.<item>' will have higher precedence than
@@ -221,6 +227,9 @@ sendemail.identity::
identities and to hoist sensitive authentication information
out of the repository and into the global configuration file.
+sendemail.signedoffcc::
+ Default for --[no-]signed-off-by-cc.
+
sendemail.smtpencryption::
Default encryption method. Use 'ssl' for SSL (and specify an
appropriate port), or 'tls' for TLS. Takes precedence over
@@ -241,6 +250,15 @@ sendemail.smtpssl::
sendemail.smtpuser::
Default SMTP-AUTH username.
+sendemail.suppresscc::
+ Default for --supress-cc.
+
+sendemail.suppressfrom::
+ Default for --[no-]suppress-from
+
+sendemail.thread::
+ Default for --[no-]thread
+
sendemail.to::
Email address (or alias) to always send to.
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH 6/8] Docs: Arranged config options in man page
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1222564196-84202-5-git-send-email-mfwitten@mit.edu>
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Documentation/git-send-email.txt | 44 +++++++++++++++++++-------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 6b62032..8aa5098 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -196,13 +196,6 @@ This option can be set with sendemail[.<identity>].validate; default to --valida
CONFIGURATION
-------------
-sendemail.identity::
- The default configuration identity. When specified,
- 'sendemail.<identity>.<item>' will have higher precedence than
- 'sendemail.<item>'. This is useful to declare multiple SMTP
- identities and to hoist sensitive authentication information
- out of the repository and into the global configuration file.
-
sendemail.aliasesfile::
To avoid typing long email addresses, point this to one or more
email aliases files. You must also supply 'sendemail.aliasfiletype'.
@@ -211,38 +204,45 @@ sendemail.aliasfiletype::
Format of the file(s) specified in sendemail.aliasesfile. Must be
one of 'mutt', 'mailrc', 'pine', or 'gnus'.
-sendemail.to::
- Email address (or alias) to always send to.
+sendemail.bcc::
+ Email address (or alias) to always bcc.
sendemail.cccmd::
Command to execute to generate per patch file specific "Cc:"s.
-sendemail.bcc::
- Email address (or alias) to always bcc.
-
sendemail.chainreplyto::
Boolean value specifying the default to the '--[no-]chain-reply-to'
parameter.
+sendemail.identity::
+ The default configuration identity. When specified,
+ 'sendemail.<identity>.<item>' will have higher precedence than
+ 'sendemail.<item>'. This is useful to declare multiple SMTP
+ identities and to hoist sensitive authentication information
+ out of the repository and into the global configuration file.
+
+sendemail.smtpencryption::
+ Default encryption method. Use 'ssl' for SSL (and specify an
+ appropriate port), or 'tls' for TLS. Takes precedence over
+ 'smtpssl' if both are specified.
+
+sendemail.smtppass::
+ Default SMTP-AUTH password.
+
sendemail.smtpserver::
Default SMTP server to use.
sendemail.smtpserverport::
Default SMTP server port to use.
+sendemail.smtpssl::
+ Legacy boolean that sets 'smtpencryption=ssl' if enabled.
+
sendemail.smtpuser::
Default SMTP-AUTH username.
-sendemail.smtppass::
- Default SMTP-AUTH password.
-
-sendemail.smtpencryption::
- Default encryption method. Use 'ssl' for SSL (and specify an
- appropriate port), or 'tls' for TLS. Takes precedence over
- 'smtpssl' if both are specified.
-
-sendemail.smtpssl::
- Legacy boolean that sets 'smtpencryption=ssl' if enabled.
+sendemail.to::
+ Email address (or alias) to always send to.
sendemail.validate::
Boolean override for --[no-]validate.
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH 3/8] Docs: send-email: Man page option ordering
From: Michael Witten @ 2008-09-28 1:09 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1222564196-84202-2-git-send-email-mfwitten@mit.edu>
Now the man page lists the options in alphabetical
order (in terms of the 'main' part of an option's
name).
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
Documentation/git-send-email.txt | 138 ++++++++++++++++++--------------------
1 files changed, 66 insertions(+), 72 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 9b31626..0c6dbf6 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -11,7 +11,6 @@ SYNOPSIS
'git send-email' [options] <file|directory> [... file|directory]
-
DESCRIPTION
-----------
Takes the patches given on the command line and emails them out.
@@ -45,19 +44,35 @@ The --cc option must be repeated for each user you want on the cc list.
email sent. If disabled with "--no-chain-reply-to", all emails after
the first will be sent as replies to the first email sent. When using
this, it is recommended that the first file given be an overview of the
- entire patch series.
- Default is the value of the 'sendemail.chainreplyto' configuration
- value; if that is unspecified, default to --chain-reply-to.
+ entire patch series. Default is the value of the 'sendemail.chainreplyto'
+ configuration value; if that is unspecified, default to --chain-reply-to.
--compose::
Use $GIT_EDITOR, core.editor, $VISUAL, or $EDITOR to edit an
introductory message for the patch series.
+--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. Default is the value of
+ the 'sendemail.envelopesender' configuration variable; if that is
+ unspecified, choosing the envelope sender is left to your MTA.
+
--from::
Specify the sender of the emails. This will default to
the value GIT_COMMITTER_IDENT, as returned by "git var -l".
The user will still be prompted to confirm this entry.
+--identity::
+ A configuration identity. When given, causes values in the
+ 'sendemail.<identity>' subsection to take precedence over
+ values in the 'sendemail' section. The default identity is
+ the value of 'sendemail.identity'.
+
--in-reply-to::
Specify the contents of the first In-Reply-To header.
Subsequent emails will refer to the previous email
@@ -65,21 +80,40 @@ The --cc option must be repeated for each user you want on the cc list.
Only necessary if --compose is also set. If --compose
is not set, this will be prompted for.
---[no-]signed-off-by-cc::
- If this is set, add emails found in Signed-off-by: or Cc: lines to the
- cc list.
- Default is the value of 'sendemail.signedoffcc' configuration value;
- if that is unspecified, default to --signed-off-by-cc.
-
--quiet::
Make git-send-email less verbose. One line per email should be
all that is output.
---identity::
- A configuration identity. When given, causes values in the
- 'sendemail.<identity>' subsection to take precedence over
- values in the 'sendemail' section. The default identity is
- the value of 'sendemail.identity'.
+--[no-]signed-off-by-cc::
+ If this is set, add emails found in Signed-off-by: or Cc: lines to the
+ cc list. Default is the value of 'sendemail.signedoffcc' configuration
+ value; if that is unspecified, default to --signed-off-by-cc.
+
+--smtp-encryption::
+ Specify the encryption to use, either 'ssl' or 'tls'. Any other
+ value reverts to plain SMTP. Default is the value of
+ 'sendemail.smtpencryption'.
+
+--smtp-pass::
+ Password for SMTP-AUTH. The argument is optional: If no
+ argument is specified, then the empty string is used as
+ the password.
++
+In place of this option, the following configuration variables
+can be specified:
++
+--
+ * sendemail.smtppass
+ * sendemail.<identity>.smtppass (see sendemail.identity).
+--
++
+However, --smtp-pass always overrides these variables.
++
+Furthermore, passwords need not be specified in configuration files
+or on the command line. If a username has been specified (with
+--smtp-user or a configuration variable), but no password has been
+specified (with --smtp-pass or a configuration variable), then the
+user is prompted for a password while the input is masked for privacy.
--smtp-server::
If set, specifies the outgoing SMTP server to use (e.g.
@@ -96,6 +130,9 @@ The --cc option must be repeated for each user you want on the cc list.
servers typically listen to smtp port 25 and ssmtp port
465).
+--smtp-ssl::
+ Legacy alias for '--smtp-encryption=ssl'.
+
--smtp-user::
Username for SMTP-AUTH. In place of this option, the following
configuration variables can be specified:
@@ -110,45 +147,11 @@ However, --smtp-user always overrides these variables.
If a username is not specified (with --smtp-user or a
configuration variable), then authentication is not attempted.
---smtp-pass::
- Password for SMTP-AUTH. The argument is optional: If no
- argument is specified, then the empty string is used as
- the password.
-+
-In place of this option, the following configuration variables
-can be specified:
-+
---
- * sendemail.smtppass
- * sendemail.<identity>.smtppass (see sendemail.identity).
---
-+
-However, --smtp-pass always overrides these variables.
-+
-Furthermore, passwords need not be specified in configuration files
-or on the command line. If a username has been specified (with
---smtp-user or a configuration variable), but no password has been
-specified (with --smtp-pass or a configuration variable), then the
-user is prompted for a password while the input is masked for privacy.
-
---smtp-encryption::
- Specify the encryption to use, either 'ssl' or 'tls'. Any other
- value reverts to plain SMTP. Default is the value of
- 'sendemail.smtpencryption'.
-
---smtp-ssl::
- Legacy alias for '--smtp-encryption=ssl'.
-
--subject::
Specify the initial subject of the email thread.
Only necessary if --compose is also set. If --compose
is not set, this will be prompted for.
---[no-]suppress-from::
- If this is set, do not add the From: address to the cc: list.
- Default is the value of 'sendemail.suppressfrom' configuration value;
- if that is unspecified, default to --no-suppress-from.
-
--suppress-cc::
Specify an additional category of recipients to suppress the
auto-cc of. 'self' will avoid including the sender, 'author' will
@@ -160,24 +163,24 @@ user is prompted for a password while the input is masked for privacy.
if that is unspecified, default to 'self' if --suppress-from is
specified, as well as 'sob' if --no-signed-off-cc is specified.
+--[no-]suppress-from::
+ If this is set, do not add the From: address to the cc: list.
+ Default is the value of 'sendemail.suppressfrom' configuration
+ value; if that is unspecified, default to --no-suppress-from.
+
--[no-]thread::
If this is set, the In-Reply-To header will be set on each email sent.
If disabled with "--no-thread", no emails will have the In-Reply-To
- header set.
- Default is the value of the 'sendemail.thread' configuration value;
- if that is unspecified, default to --thread.
+ header set. Default is the value of the 'sendemail.thread' configuration
+ value; if that is unspecified, default to --thread.
---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.
- Default is the value of the 'sendemail.envelopesender' configuration
- variable; if that is unspecified, choosing the envelope sender is left
- to your MTA.
+--to::
+ Specify the primary recipient of the emails generated. Generally, this
+ will be the upstream maintainer of the project involved. Default is the
+ value of the 'sendemail.to' configuration value; if that is unspecified,
+ this will be prompted for.
++
+The --to option must be repeated for each user you want on the to list.
--no-validate::
Don't perform any sanity checks on patches.
@@ -188,15 +191,6 @@ user is prompted for a password while the input is masked for privacy.
is due to SMTP limits as described by http://www.ietf.org/rfc/rfc2821.txt.
--
---to::
- Specify the primary recipient of the emails generated.
- Generally, this will be the upstream maintainer of the
- project involved.
- Default is the value of the 'sendemail.to' configuration value;
- if that is unspecified, this will be prompted for.
-+
-The --to option must be repeated for each user you want on the to list.
-
CONFIGURATION
-------------
--
1.6.0.2.304.g577ee
^ permalink raw reply related
* [PATCH] Use strchrnul() instead of strchr() plus manual workaround
From: Johan Herland @ 2008-09-27 22:24 UTC (permalink / raw)
To: Nanako Shiraishi, Shawn O. Pearce; +Cc: git
In-Reply-To: <20080928070858.6117@nanako3.lavabit.com>
Also gets rid of a C++ comment.
Signed-off-by: Johan Herland <johan@herland.net>
---
On Sunday 28 September 2008, Nanako Shiraishi wrote:
> Why does this C++ style comment talk about "simulate"?
>
> Don't other parts of git already use strchrnul()?
Oops. Sorry about that. The man page for strchrnul() says that it is
a GNU extension, so I stayed away from it. Of course, I should have
grepped the git source instead...
This should fix it.
...Johan
builtin-for-each-ref.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index e59bd80..fa6c1ed 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -320,9 +320,7 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
static const char *copy_line(const char *buf)
{
- const char *eol = strchr(buf, '\n');
- if (!eol) // simulate strchrnul()
- eol = buf + strlen(buf);
+ const char *eol = strchrnul(buf, '\n');
return xmemdupz(buf, eol - buf);
}
--
1.6.0.2.471.g47a76
^ permalink raw reply related
* Re: [PATCH] for-each-ref: Fix --format=%(subject) for log message without newlines
From: Nanako Shiraishi @ 2008-09-27 22:08 UTC (permalink / raw)
To: Johan Herland; +Cc: git, Shawn O. Pearce
Johan Herland <johan@herland.net> writes:
> builtin-for-each-ref.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
> index 9b44092..e59bd80 100644
> --- a/builtin-for-each-ref.c
> +++ b/builtin-for-each-ref.c
> @@ -321,8 +321,8 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
> static const char *copy_line(const char *buf)
> {
> const char *eol = strchr(buf, '\n');
> - if (!eol)
> - return "";
> + if (!eol) // simulate strchrnul()
> + eol = buf + strlen(buf);
> return xmemdupz(buf, eol - buf);
> }
Why does this C++ style comment talk about "simulate"?
Don't other parts of git already use strchrnul()?
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: [PATCH 4/4] cygwin: Use native Win32 API for stat
From: Dmitry Potapov @ 2008-09-27 21:54 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, Junio C Hamano, Shawn O. Pearce, Alex Riesen, Marcus Griep
In-Reply-To: <200809272035.03833.johannes.sixt@telecom.at>
On Sat, Sep 27, 2008 at 08:35:03PM +0200, Johannes Sixt wrote:
>
> > +core.cygwinNativeStat::
>
> This name is *really* odd, for two reasons:
>
> - If I read "native" in connection with Windows, I would understand Windows's
> implementation as "native". Cygwin is not native - it's a bolted-on feature.
>
> - This name talks about the implementation, not about its effect.
>
> Perhaps a better name would be core.ignoreCygwinFSFeatures, and the
> description would only mention that setting this to true (the default) makes
> many operations much faster, but makes it impossible to use File System
> Features A and B and C in the repository. "If you need one of these features,
> set this to false."
>
> (And after writing above paragraphs I notice, that you actually really meant
> Windows's "native" stat; see how confusing the name is?)
It was Shawn's suggestion. I don't care much about the name as long as
it is explained in the documentation... Therefore, I accepted what Shawn
said without giving it any thought. Now, when you bring this name to my
attention, I believe core.useCygwinStat (in the opposite to the current
core.cygwinNativeStat) would be a better name. Your name is okay too,
but a bit too long for my taste and not specific enough (I suppose
Cygwin does many FS related tricks). Anyway, I don't have a strong
opinion here, so just whatever most people like is fine with me :)
>
> > +static inline void filetime_to_timespec(const FILETIME *ft, struct
> > timespec *ts) +{
> > + long long winTime = ((long long)ft->dwHighDateTime << 32) +
> > ft->dwLowDateTime; + winTime -= 116444736000000000LL; /* Windows to Unix
> > Epoch conversion */ + ts->tv_sec = (time_t)(winTime/10000000); /*
> > 100-nanosecond interval to seconds */ + ts->tv_nsec = (long)(winTime -
> > ts->tv_sec*10000000LL) * 100; /* nanoseconds */ +}
>
> Shorter lines in this function would be appreciated (and not just because my
> MUA can't deal with them ;).
I am sorry, I did not notice that the line got longer than 80 columns.
I will resent the patch once the issue with the name of the option is
resolved.
Dmitry
^ permalink raw reply
* Re: [PATCH 3/4] mingw: move common functionality to win32.h
From: Dmitry Potapov @ 2008-09-27 21:51 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, Junio C Hamano, Shawn O. Pearce, Alex Riesen, Marcus Griep
In-Reply-To: <200809272034.04931.johannes.sixt@telecom.at>
On Sat, Sep 27, 2008 at 08:34:04PM +0200, Johannes Sixt wrote:
> On Samstag, 27. September 2008, Dmitry Potapov wrote:
> > +static inline int get_file_attr(const char *fname,
> > WIN32_FILE_ATTRIBUTE_DATA *fdata) +{
> > + if (GetFileAttributesExA(fname, GetFileExInfoStandard, fdata))
> > + return 0;
> > +
> > + switch (GetLastError()) {
> > + case ERROR_ACCESS_DENIED:
> > + case ERROR_SHARING_VIOLATION:
> > + case ERROR_LOCK_VIOLATION:
> > + case ERROR_SHARING_BUFFER_EXCEEDED:
> > + return EACCES;
> > + case ERROR_BUFFER_OVERFLOW:
> > + return ENAMETOOLONG;
> > + case ERROR_NOT_ENOUGH_MEMORY:
> > + return ENOMEM;
> > + default:
> > + return ENOENT;
> > + }
> > +}
>
> I've long wished for a function that translates Win32 error codes to errno
> codes. It would be useful in a number of other places, too.
>
> Here you introduce a new function get_file_attr() that is nothing but
> GetFileAttributesExA() followed by such an error code translation.
>
> I suggest that we leave the original call to GetFileAttributesExA() alone and
> have a function win32_to_errno(void) that is just the switch statement above.
win32_to_errno was the first thing that implemented but then released
that translation of Win32 errors to errno cannot be in general case.
For instance, ERROR_BUFFER_OVERFLOW means ENAMETOOLONG here, but it
can be translated to ETOOSMALL in other cases. How do you propose to
deal with that?
So I have not found a better solution than to add get_file_attr(), which
calls GetFileAttributesExA() and translates Win32 error.
Dmitry
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox