Re: bash completion patch

2014-02-09 Thread Thomas Rast
Junio C Hamano gits...@pobox.com writes:

 Matthieu Moy matthieu@grenoble-inp.fr writes:

[...]
 don't forget to Cc Junio if
 you think your patch is ready for inclusion.

 Heh, thanks.  Everybody seems to think anything they send out to the
 list is ready for inclusion, so the last part may not be a piece of
 advice that is practically very useful, though ;-)

That happens to me a lot, too.  Perhaps it would be a clearer signal if
you had an alias (or just something like gitster+patch) that we can send
it to if we mean please include instead of what do you think of this?

-- 
Thomas Rast
t...@thomasrast.ch
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Bug: relative core.worktree is resolved from symlink and not its target

2014-02-09 Thread Duy Nguyen
On Tue, Feb 04, 2014 at 11:20:39AM +0100, Daniel Hahler wrote:
 Hi,
 
 when using a submodule sm, there is a relative worktree in its config:
 
.git/modules/sm/config:
[core]
 worktree = ../../../smworktree
 
 git-new-worktree (from contrib) symlinks this config the new worktree.
 
 From inside the new worktree, git reads the config, but resolves the
 relative worktree setting based on the symlink's location.

Hmm.. core.worktree is relative to $GIT_DIR. Whether config is a
symlink should have no effects.

$ pwd
/tmp/abc
$ ls -l .git/config 
lrwxrwxrwx 1 pclouds users 11 Feb  9 15:57 .git/config - /tmp/config
$ cat /tmp/config 
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
worktree = ../../worktree
$ ls -l /tmp/worktree/
total 4
-rw-r--r-- 1 pclouds users 5 Feb  9 15:59 abc
$ ~/w/git/git ls-files -o
abc

Maybe it's something else. Could you produce a small test case?

 A fix would be to resolve any relative worktree setting based on the
 symlink target's location (the actual config file), and not from the
 symlink.
 
 This is with git version 1.8.5.3.
--
Duy
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Bug: Problem with CRLF line ending in git-diff with coloring

2014-02-09 Thread Stefan-W. Hahn
Good morning,

when diffing output where files have CRLF line ending, the coloring
seems wrong, because in changed lines the CR (^M) is highlighted,
even if the line ending has not changed.

The diff engine itself is correct.

I added a test case to show this behaviour.

The problem seems to come from emit_add_line() where ws_check_emit() is
called.  The parameter ecbdata-ws_rule has not set WS_CR_AT_EOL. In this
case ws_check_emit() handles the CR at eol as whitespace character and
therfore highlights it. This seems wrong for files with CRLF lineending.

,
| static void emit_add_line(const char *reset,
| struct emit_callback *ecbdata,
| const char *line, int len)
| {
| const char *ws = diff_get_color(ecbdata-color_diff, DIFF_WHITESPACE);
| ...
| 
|   if (!*ws)
| ...
|   else {
|   /* Emit just the prefix, then the rest. */
|   emit_line_0(ecbdata-opt, set, reset, '+', , 0);
|   ws_check_emit(line, len, ecbdata-ws_rule,
| ecbdata-opt-file, set, reset, ws);
|   }
| }
`

If WS_CR_AT_EOL is set in ecbdata-ws_rule, it works correctly, but this seems
not the right solutions. (Sorry, but I'm not deep enough in the code to
propose a solution.)

Another nitpick: While writing the test it was unclear for me where the color
start and end sequences will be put. Here is a difference between old lines and
new lines, because old lines will be printed with emit_line_0() and new lines
with emit_line_0() + ws_check_emit(). So in case of new lines the + itself
is enclosed by the color sequences, where in case of the old lines the whole
line is enclosed by the color sequences.

I tested this with 6a7071958620dad (Git 1.9.0-rc3), but this is also wrong
in older versions.

With kind regards,
Stefan

---
 t/t4060-diff-eol.sh | 81 +
 1 files changed, 81 insertions(+), 0 deletion(-)
 create mode 100755 t/t4060-diff-eol.sh

diff --git a/t/t4060-diff-eol.sh b/t/t4060-diff-eol.sh
new file mode 100755
index 000..8cf9a69
--- /dev/null
+++ b/t/t4060-diff-eol.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+#
+# Copyright (c) 2014 Stefan-W. Hahn
+#
+
+test_description='Test coloring of diff with CRLF line ending.
+
+'
+. ./test-lib.sh
+
+get_color ()
+{
+   git config --get-color $1
+}
+
+tr 'Q' '\015'  EOF  x
+Zeile 1Q
+Zeile 2Q
+Zeile 3Q
+EOF
+
+git update-index --add x
+
+tr 'Q' '\015'  EOF  x
+Zeile 1Q
+Zeile 22Q
+Zeile 3Q
+EOF
+
+tr 'Q' '\015'  EOF  expect
+diff --git a/x b/x
+index 3411cc1..68a4b2c 100644
+--- a/x
 b/x
+@@ -1,3 +1,3 @@
+ Zeile 1Q
+-Zeile 2Q
++Zeile 22Q
+ Zeile 3Q
+EOF
+
+
+git -c color.diff=false diff  out
+test_expect_success diff files ending with CRLF without color '
+test_cmp expect out'
+
+test_expect_success setup '
+git config color.diff.plain black 
+git config color.diff.meta blue 
+git config color.diff.frag yellow 
+git config color.diff.func normal 
+git config color.diff.old red 
+git config color.diff.new green 
+git config color.diff.commit normal 
+   c_reset=$(git config --get-color no.such.color reset) 
+   c_plain=$(get_color color.diff.plain) 
+   c_meta=$(get_color color.diff.meta) 
+   c_frag=$(get_color color.diff.frag) 
+   c_func=$(get_color color.diff.func) 
+   c_old=$(get_color color.diff.old) 
+   c_new=$(get_color color.diff.new) 
+   c_commit=$(get_color color.diff.commit) 
+   c_whitespace=$(get_color color.diff.whitespace)
+'
+
+tr 'Q' '\015'  EOF  expect
+${c_meta}diff --git a/x b/x${c_reset}
+${c_meta}index 3411cc1..68a4b2c 100644${c_reset}
+${c_meta}--- a/x${c_reset}
+${c_meta}+++ b/x${c_reset}
+${c_frag}@@ -1,3 +1,3 @@${c_reset}
+${c_plain} Zeile 1${c_reset}Q
+${c_old}-Zeile 2${c_reset}Q
+${c_new}+${c_reset}${c_new}Zeile 22${c_reset}Q
+${c_plain} Zeile 3${c_reset}Q
+EOF
+
+git -c color.diff=always diff  out
+test_expect_success diff files ending with CRLF with color coding 'test_cmp 
expect out'
+
+test_done
-- 
1.8.3.2.733.gf8abaeb



-- 
Stefan-W. Hahn  It is easy to make things.
It is hard to make things simple.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 01/14] Add data structures and basic functions for commit trailers

2014-02-09 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com

 Christian Couder chrisc...@tuxfamily.org writes:
 
 +enum action_where { WHERE_AFTER, WHERE_BEFORE };
 +enum action_if_exist { EXIST_ADD_IF_DIFFERENT, 
 EXIST_ADD_IF_DIFFERENT_NEIGHBOR,
 +   EXIST_ADD, EXIST_OVERWRITE, EXIST_DO_NOTHING };
 +enum action_if_missing { MISSING_ADD, MISSING_DO_NOTHING };
 
 All these names and conf_info below are not named to be specific
 to this little tool.  Can I assume that these will never be exposed
 to the rest of the system?  If so, they are fine.

Yeah, I don't plan them to be exposed to other files.
 
 +struct conf_info {
 +char *name;
 +char *key;
 +char *command;
 +enum action_where where;
 +enum action_if_exist if_exist;
 +enum action_if_missing if_missing;
 
 It still feels somewhat strange.  It is true that an item can be
 either exist or missing and it is understandable that it tempts
 you to split that into two, but EXIST_OVERWRITE will not trigger
 either WHERE_AFTER or WHERE_BEFORE action.

Yeah, it's true that WHERE_AFTER/WHERE_BEFORE does not make sense for
EXIST_OVERWRITE, EXIST_DO_NOTHING and MISSING_DO_NOTHING, but it's a
fact of life that sometimes some options do not make sense with
others.

 +static inline int same_token(struct trailer_item *a, struct trailer_item 
 *b, int alnum_len)
 +{
 +return !strncasecmp(a-token, b-token, alnum_len);
 +}
 +
 +static inline int same_value(struct trailer_item *a, struct trailer_item *b)
 +{
 +return !strcasecmp(a-value, b-value);
 +}
 +
 +static inline int same_trailer(struct trailer_item *a, struct trailer_item 
 *b, int alnum_len)
 +{
 +return same_token(a, b, alnum_len)  same_value(a, b);
 +}
 
 All these inlines look premature optimization that can be
 delegated to any decent compiler, don't they?

Yeah, but as Eric suggested to add them like in header files and you
did not reply to him, I thought you agreed with him.
I will remove them.

 +/* Get the length of buf from its beginning until its last alphanumeric 
 character */
 +static inline size_t alnum_len(const char *buf, int len)
 +{
 +while (--len = 0  !isalnum(buf[len]));
 
 Style:
 
   while (--len = 0  !isalnum(buf[len]))
   ;
 
 You may add a comment on the empty statement to make it stand out
 even more, i.e.
 
   ; /* nothing */

Ok, I will do that.

 +return (size_t) len + 1;
 
 This is somewhat unfortunate.  if the caller wants to receive
 size_t, perhaps it should be passing in size_t (or ssize_t) to the
 function?  Hard to guess without an actual caller, though.

Ok, I will make it return an int.

Thanks,
Christian.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 01/14] Add data structures and basic functions for commit trailers

2014-02-09 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com

 Christian Couder chrisc...@tuxfamily.org writes:
 
 +enum action_if_exist if_exist;
 +enum action_if_missing if_missing;
 
 Probably if_exists is more gramatically correct.
 
   if (x-if_exists) {
   ... do this ...
   }
 
 would read well, but not x-if_exist.

Ok, I will use if_exists instead of if_exist and also:

enum action_if_exists { EXISTS_ADD_IF_DIFFERENT, 
EXISTS_ADD_IF_DIFFERENT_NEIGHBOR,
EXISTS_ADD, EXISTS_OVERWRITE, EXISTS_DO_NOTHING };

instead of:

enum action_if_exist { EXIST_ADD_IF_DIFFERENT, EXIST_ADD_IF_DIFFERENT_NEIGHBOR,
EXIST_ADD, EXIST_OVERWRITE, EXIST_DO_NOTHING };

to be consistent.

Thanks,
Christian.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 02/14] trailer: process trailers from file and arguments

2014-02-09 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com

 Christian Couder chrisc...@tuxfamily.org writes:
 
 +static void apply_arg_if_exist(struct trailer_item *infile_tok,
 +   struct trailer_item *arg_tok,
 +   int alnum_len)
 +{
 +switch (arg_tok-conf-if_exist) {
 +case EXIST_DO_NOTHING:
 +free(arg_tok);
 +break;
 +case EXIST_OVERWRITE:
 +free((char *)infile_tok-value);
 +infile_tok-value = xstrdup(arg_tok-value);
 +free(arg_tok);
 +break;
 +case EXIST_ADD:
 +add_arg_to_infile(infile_tok, arg_tok);
 +break;
 +case EXIST_ADD_IF_DIFFERENT:
 +if (check_if_different(infile_tok, arg_tok, alnum_len, 1))
 +add_arg_to_infile(infile_tok, arg_tok);
 +else
 +free(arg_tok);
 +break;
 +case EXIST_ADD_IF_DIFFERENT_NEIGHBOR:
 +if (check_if_different(infile_tok, arg_tok, alnum_len, 0))
 +add_arg_to_infile(infile_tok, arg_tok);
 +else
 +free(arg_tok);
 +break;
 
 Makes me wonder if people want a rule to say if the same key
 already exists, regardless of the value.

This is what if_exists and if_missing are all about.

Either:

the same key already exists regardless of the value

and, in this case, what happens depends on what has been specified using
the if_exists configuration variable.

Or:

the same key DOES NOT already exists regardless of the value

and in this case, what happens depends on what has been specified
using the if_missing configuration variable.

 +static void remove_from_list(struct trailer_item *item,
 + struct trailer_item **first)
 +{
 +if (item-next)
 +item-next-previous = item-previous;
 +if (item-previous)
 +item-previous-next = item-next;
 +else
 +*first = item-next;
 +}
 
 Will callers free the item that now is not on the list?

Yes, or the item will be inserted into another list.

 +static struct trailer_item *remove_first(struct trailer_item **first)
 +{
 +struct trailer_item *item = *first;
 +*first = item-next;
 +if (item-next) {
 +item-next-previous = NULL;
 +item-next = NULL;
 +}
 +return item;
 +}
 +
 +static void process_infile_tok(struct trailer_item *infile_tok,
 +   struct trailer_item **arg_tok_first,
 +   enum action_where where)
 +{
 +struct trailer_item *arg_tok;
 +struct trailer_item *next_arg;
 +
 +int tok_alnum_len = alnum_len(infile_tok-token, 
 strlen(infile_tok-token));
 +for (arg_tok = *arg_tok_first; arg_tok; arg_tok = next_arg) {
 +next_arg = arg_tok-next;
 +if (same_token(infile_tok, arg_tok, tok_alnum_len) 
 +arg_tok-conf-where == where) {
 +remove_from_list(arg_tok, arg_tok_first);
 +apply_arg_if_exist(infile_tok, arg_tok, tok_alnum_len);
 +/*
 + * If arg has been added to infile,
 + * then we need to process it too now.
 + */
 +if ((where == WHERE_AFTER ? infile_tok-next : 
 infile_tok-previous) == arg_tok)
 +infile_tok = arg_tok;
 +}
 +}
 +}
 +
 +static void update_last(struct trailer_item **last)
 +{
 +if (*last)
 +while((*last)-next != NULL)
 +*last = (*last)-next;
 +}
 +
 +static void update_first(struct trailer_item **first)
 +{
 +if (*first)
 +while((*first)-previous != NULL)
 +*first = (*first)-previous;
 +}
 +
 +static void apply_arg_if_missing(struct trailer_item **infile_tok_first,
 + struct trailer_item **infile_tok_last,
 + struct trailer_item *arg_tok)
 +{
 
 Makes me wonder if it would make the code simpler to keep an anchor
 item struct trailer_item that is off heap, and pass that single
 anchor item around, using its next/prev fields as the first and the
 last.  Wouldn't it let you remove the special cases for the first
 and last item?

Yeah, that could work. On the other hand the other fields of this
special item would not be used for anything.
I will have a look at it.

 +struct trailer_item **infile_tok;
 +enum action_where where;
 +
 +switch (arg_tok-conf-if_missing) {
 +case MISSING_DO_NOTHING:
 +free(arg_tok);
 +break;
 +case MISSING_ADD:
 +where = arg_tok-conf-where;
 +infile_tok = (where == WHERE_AFTER) ? infile_tok_last : 
 infile_tok_first;
 +if (*infile_tok) {
 +add_arg_to_infile(*infile_tok, arg_tok);
 +*infile_tok = arg_tok;
 +} else {
 +

Re: [PATCH v4 10/17] trailer: if no input file is passed, read from stdin

2014-02-09 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com
Subject: Re: [PATCH v4 10/17] trailer: if no input file is passed, read from 
stdin
Date: Thu, 06 Feb 2014 13:51:36 -0800

 Christian Couder chrisc...@tuxfamily.org writes:
 
 It is simpler and more natural if the git interpret-trailers
 is made a filter as its output already goes to sdtout.
 
 sdtout???

Sorry, I have a hard time spelling porprelly these days :-)

Thanks,
Christian.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 04/14] trailer: process command line trailer arguments

2014-02-09 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com
Subject: Re: [PATCH v5 04/14] trailer: process command line trailer arguments
Date: Thu, 06 Feb 2014 16:08:24 -0800

 Christian Couder chrisc...@tuxfamily.org writes:
 
 This patch parses the trailer command line arguments
 and put the result into an arg_tok doubly linked
 list.
 
 No the patch doesn't parse anything ;-).
 
 Parse the command line arguments and 
 
 +static void parse_trailer(struct strbuf *tok, struct strbuf *val, const 
 char *trailer)
 +{
 +const char *end = strchr(trailer, '=');
 +if (!end)
 +end = strchr(trailer, ':');
 
 How would you explain the behaviour of the above code for this
 input?
 
   frotz: nitfol=xyzzy
 
 Perhaps strcspn()?

Ok to use strcspn().

Thanks,
Christian.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] bash completion: Add --recurse-submodules

2014-02-09 Thread Sup Yut Sum
Signed-off-by: Sup Yut Sum ch3co...@gmail.com
---
 contrib/completion/git-completion.bash | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash 
b/contrib/completion/git-completion.bash
index 9525343..87de809 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1221,14 +1221,20 @@ _git_difftool ()
__git_complete_revlist_file
 }
 
+__git_fetch_recurse_submodules=yes on-demand no
+
 __git_fetch_options=
--quiet --verbose --append --upload-pack --force --keep --depth=
-   --tags --no-tags --all --prune --dry-run
+   --tags --no-tags --all --prune --dry-run --recurse-submodules=
 
 
 _git_fetch ()
 {
case $cur in
+   --recurse-submodules=*)
+   __gitcomp $__git_fetch_recurse_submodules  
${cur##--recurse-submodules=}
+   return
+   ;;
--*)
__gitcomp $__git_fetch_options
return
@@ -1583,6 +1589,10 @@ _git_pull ()
__git_complete_strategy  return
 
case $cur in
+   --recurse-submodules=*)
+   __gitcomp $__git_fetch_recurse_submodules  
${cur##--recurse-submodules=}
+   return
+   ;;
--*)
__gitcomp 
--rebase --no-rebase
@@ -1595,6 +1605,8 @@ _git_pull ()
__git_complete_remote_or_refspec
 }
 
+__git_push_recurse_submodules=check on-demand
+
 _git_push ()
 {
case $prev in
@@ -1607,10 +1619,15 @@ _git_push ()
__gitcomp_nl $(__git_remotes)  ${cur##--repo=}
return
;;
+   --recurse-submodules=*)
+   __gitcomp $__git_push_recurse_submodules  
${cur##--recurse-submodules=}
+   return
+   ;;
--*)
__gitcomp 
--all --mirror --tags --dry-run --force --verbose
--receive-pack= --repo= --set-upstream
+   --recurse-submodules=

return
;;
-- 
1.8.5.2.msysgit.0

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: gitweb.cgi bug

2014-02-09 Thread Andrew Keller
On Feb 8, 2014, at 10:19 PM, Dongsheng Song wrote:
 On Sun, Feb 9, 2014 at 12:29 AM, Andrew Keller and...@kellerfarm.com wrote:
 On Feb 8, 2014, at 8:37 AM, Dongsheng Song wrote:
 
 I have an git repo PROJECT.git, the full path is /srv/repo/git/PROJECT.git,
 when I set git_base_url_list in gitweb.conf:
 
 @git_base_url_list = qw(https://192.168.30.239/repo/git
   git@192.168.30.239:repo/git);
 
 I got the result:
 
 https://192.168.30.239/repo/git/PROJECT.git
 git@192.168.30.239:/PROJECT.git
 
 This is wrong, it should be (without the leading '/')
 git@192.168.30.239:PROJECT.git
 
 There is no way to generate a fetch url of 'git@192.168.30.239:PROJECT.git' 
 in gitweb.
 
 If one of the base urls was 'git@192.168.30.239:.', then you could get a 
 fetch URL of 'git@192.168.30.239:./PROJECT.git'
 
 In general, though, I like to stay away from relative paths.  Weird things 
 can happen, like HTTP works but SSH doesn't, because the home directory for 
 SSH changed because you used a different user.
 
 What's about the following translate rules ?
 
 git@192.168.30.239:  - git@192.168.30.239:PROJECT.git
 git@192.168.30.239:/ - git@192.168.30.239:/PROJECT.git
 git@192.168.30.239:/repo  - git@192.168.30.239:/repo/PROJECT.git
 git@192.168.30.239:/repo/ - git@192.168.30.239:/repo/PROJECT.git

I think that those translation rules are completely reasonable.

However, that's not what gitweb was originally designed to do.  What you're 
describing is a desire for a new feature, not the existence of a bug.  
Basically, gitweb does not support relative paths when the base url does not 
contain part of the path already.

 I don't know Perl, but I think change the following translate code is
 not a hard work:
 
# use per project git URL list in $projectroot/$project/cloneurl
# or make project git URL from git base URL and project name
my $url_tag = URL;
my @url_list = git_get_project_url_list($project);
@url_list = map { $_/$project } @git_base_url_list unless @url_list;
foreach my $git_url (@url_list) {
next unless $git_url;
print format_repo_url($url_tag, $git_url);
$url_tag = ;
}

You're right - that is where the change should be applied, and the change you 
suggest is pretty simple.

However, I'm not confident that the syntax for a relative path is the same for 
all schemes.  (Others on the list, feel free to object.)  Since gitweb blindly 
concatenates the base URL and the relative project path, I'm worried that 
adding the proper functionality for one scheme will yield incorrect behavior 
for another scheme.

Can you move your repository to a subfolder?  Can use use absolute paths 
instead of relative paths?  Either of those approaches work around this issue.  
I don't mean to coldly tell you that the solution is don't do that, but on 
the surface, this seems like a nasty problem.

 - Andrew

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] saa7134: Add support for SnaZio TvPVR PRO

2014-02-09 Thread POJAR GEORGE
From: POJAR GEORGE geoubu...@gmail.com

Signed-off-by: POJAR GEORGE geoubu...@gmail.com
---
 Documentation/video4linux/CARDLIST.saa7134 |   1 +
 drivers/media/pci/saa7134/saa7134-cards.c  |  51 ++-
 drivers/media/pci/saa7134/saa7134-input.c  |  62 +
 drivers/media/pci/saa7134/saa7134.h|   1 +
 drivers/media/rc/keymaps/Makefile  |   1 +
 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c | 116 +
 include/media/rc-map.h |   1 +
 7 files changed, 232 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c

diff --git a/Documentation/video4linux/CARDLIST.saa7134 
b/Documentation/video4linux/CARDLIST.saa7134
index 8df17d0..32e4353 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -191,3 +191,4 @@
 190 - Asus My Cinema PS3-100   [1043:48cd]
 191 - Hawell HW-9004V1
 192 - AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
+193 - SnaZio TvPVR PRO 
[0x1779:0x13cf,0x1779:0x13d0,0x1779:0x13d1]
diff --git a/drivers/media/pci/saa7134/saa7134-cards.c 
b/drivers/media/pci/saa7134/saa7134-cards.c
index d45e7f6..3476785 100644
--- a/drivers/media/pci/saa7134/saa7134-cards.c
+++ b/drivers/media/pci/saa7134/saa7134-cards.c
@@ -5827,7 +5827,37 @@ struct saa7134_board saa7134_boards[] = {
.gpio = 0x800,
},
},
-
+   [SAA7134_BOARD_SNAZIO_TVPVR_PRO] = {
+   .name   = SnaZio TvPVR PRO,
+   .audio_clock= 0x00187de7,
+   .tuner_type = TUNER_PHILIPS_TDA8290,
+   .radio_type = UNSET,
+   .tuner_addr = ADDR_UNSET,
+   .radio_addr = ADDR_UNSET,
+   .gpiomask   = 1  21,
+   .inputs = {{
+   .name = name_tv,
+   .vmux = 1,
+   .amux = TV,
+   .gpio = 0x000,
+   .tv   = 1,
+   }, {
+   .name = name_comp1, /* Composite input */
+   .vmux = 3,
+   .amux = LINE2,
+   .gpio = 0x000,
+   }, {
+   .name = name_svideo,/* S-Video input */
+   .vmux = 8,
+   .amux = LINE2,
+   .gpio = 0x000,
+   } },
+   .radio = {
+   .name = name_radio,
+   .amux = TV,
+   .gpio = 0x020,
+   },
+   },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -7080,6 +7110,24 @@ struct pci_device_id saa7134_pci_tbl[] = {
.subdevice= 0x2055, /* AverTV Satellite Hybrid+FM A706 */
.driver_data  = SAA7134_BOARD_AVERMEDIA_A706,
}, {
+   .vendor   = PCI_VENDOR_ID_PHILIPS,
+   .device   = PCI_DEVICE_ID_PHILIPS_SAA7133,
+   .subvendor= 0x1779,
+   .subdevice= 0x13cf,
+   .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+   }, {
+   .vendor   = PCI_VENDOR_ID_PHILIPS,
+   .device   = PCI_DEVICE_ID_PHILIPS_SAA7133,
+   .subvendor= 0x1779,
+   .subdevice= 0x13d0,
+   .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+   }, {
+   .vendor   = PCI_VENDOR_ID_PHILIPS,
+   .device   = PCI_DEVICE_ID_PHILIPS_SAA7133,
+   .subvendor= 0x1779,
+   .subdevice= 0x13d1,
+   .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+   }, {
/* --- boards without eeprom + subsystem ID --- */
.vendor   = PCI_VENDOR_ID_PHILIPS,
.device   = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -7608,6 +7656,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
case SAA7134_BOARD_BEHOLD_H7:
case SAA7134_BOARD_BEHOLD_A7:
case SAA7134_BOARD_KWORLD_PC150U:
+   case SAA7134_BOARD_SNAZIO_TVPVR_PRO:
dev-has_remote = SAA7134_REMOTE_I2C;
break;
case SAA7134_BOARD_AVERMEDIA_A169_B:
diff --git a/drivers/media/pci/saa7134/saa7134-input.c 
b/drivers/media/pci/saa7134/saa7134-input.c
index 6f43126..62ccc7d 100644
--- a/drivers/media/pci/saa7134/saa7134-input.c
+++ b/drivers/media/pci/saa7134/saa7134-input.c
@@ -416,6 +416,53 @@ static int get_key_pinnacle_color(struct IR_i2c *ir, u32 
*ir_key, u32 *ir_raw)
return get_key_pinnacle(ir, ir_key, ir_raw, 2, 0x80, 0x88);
 }
 
+/* copied and modified from get_key_msi_tvanywhere_plus() */
+static int get_key_snazio_tvpvr_pro(struct IR_i2c *ir, u32 *ir_key, u32 
*ir_raw)
+{
+   unsigned char b;
+   unsigned int gpio;
+
+   /* dev is 

Documentation about push.default=upstream is confusing

2014-02-09 Thread Ingo Rohloff
Hello,

I recently started to use git and now are digging through more and more
of the low level details.

What I recently tried was to do this for a repository created by Bob:

  git remote add -t for_bob anna url

So setup a remote (created by anna) for which a branch called 
for_bob is fetched.
Then git fetch anna.

Then
  git checkout -b from_anna anna/for_bob

So create a from_anna branch in Bobs repository which tracks the for_bob
branch in the remote anna repository.

Now git pull works as expected for the from_anna branch.

But git push does not, because from_anna has a different branch name
than the branch you want to push to (you want to push to the for_bob
branch).

So after googling I found out about the push.default=upstream config
option, which seems to do exactly what I want: It uses the tracking
information to decide to which remote branch I want to push.

Now for cross checking I looked up the documentation of push.default at
http://git-scm.com . It says:

- snip --
push.default ...

upstream - push the current branch back to the branch whose changes are
usually integrated into the current branch (which is called @{upstream}).
This mode only makes sense if you are pushing to the same repository you
would normally pull from (i.e. central workflow).

- snip -

I think the second sentence here is quite confusing.
To me it seems push.default=upstream is actually the best choice for a
*de-centralized* workflow.

Rationale:
Assume I pull the master branch from several remote repositories
(de-centralized workflow I guess).

To handle that I setup several remote tracking branches called:
  repo1_master   (tracks repo1/master)
  repo2_master   (tracks repo2/master)
  reap3_master   (tracks repo3/master)

Now without push.default=upstream I would have to either always explicitly
do something like:
  git push repo1 repo1_master:master
  git push repo2 repo2_master:master

Or modify .git/config to add that per default via push= entries.

Whereas with push.default=upstream everything works as expected it seems.

So if I am not wrong here, I would propose to rephrase the sentence
-- snip -
This mode only makes sense if you are pushing to the same repository you 
would normally pull from (i.e. central workflow).
-- snip -

To do that: Could someone point out, when it does NOT make sense to use
push.default=upstream ?

with best regards
  Ingo
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Bug: Problem with CRLF line ending in git-diff with coloring

2014-02-09 Thread Johannes Sixt
Am 09.02.2014 12:01, schrieb Stefan-W. Hahn:
 Good morning,
 
 when diffing output where files have CRLF line ending, the coloring
 seems wrong, because in changed lines the CR (^M) is highlighted,
 even if the line ending has not changed.
...
 If WS_CR_AT_EOL is set in ecbdata-ws_rule, it works correctly, but this seems
 not the right solutions.

It's the right solution. IOW, you should place something like this in
your .gitattributes:

  *.html whitespace=cr-at-eol

-- Hannes

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 00/26] inotify support

2014-02-09 Thread Torsten Bögershausen

On 2014-02-08 09.53, Duy Nguyen wrote:
 Thanks for the comments. I can see I now have some work to do in the
 coming weeks :)
 



 file-watcher.c | 32 
 1 file changed, 32 insertions(+)

 I feel a little bit unsure about the 700.
 Most often Git does not care about permissions,
 and relies on umask being set appropriatly.
 (Please correct me if I'm wrong)

Git does care. See credential-cache--daemon.c. In fact this function
is a copy of check_socket_directory() from that file.

I was probably a little bit unclear.
Of course credentials should be protected well and stored with 700.
The rest of the repo could be more loose by using adjust_shared_perm().
Because the whole repo can be shared (or not) and data is visible
to the group or everyone.
(this is a minor issue)

Please see filewatcher.c:
+   if (daemon) {
+   int err;
+   strbuf_addf(sb, %s/log, socket_path);
+   err = open(sb.buf, O_CREAT | O_TRUNC | O_WRONLY, 0600);
+   adjust_shared_perm(sb.buf);
(And now we talk about the logfile:
In daemon mode, stdout and stderr are saved in $WATCHER/log.
It could be nice to make this feature configrable,
either XXX/log or /dev/null.
On the long run we may eat to much disc space on a machine.
The other thing is that we may want to seperate stdout
from stderr, but even this is a low prio comment.



There is a small issue when I tested on a machine,
where the data directory called daten is softlinked to another disk:
daten - /disk3/home2/tb/daten

and the projects directory is softlinked to daten/projects
projects - daten/projects/

t7514 fails like this:
--- expect  2014-02-08 14:37:07.0 +
+++ actual  2014-02-08 14:37:07.0 +
@@ -1,6 +1,6 @@
 packet:  git hello
 packet:  git hello
-packet:  git index 6cb9741eee29ca02c5b79e9c0bc647bcf47ce948 
/home/tb/projects/git/tb/t/trash directory.t7514-file-watcher-lib
+packet:  git index 6cb9741eee29ca02c5b79e9c0bc647bcf47ce948 
/disk3/home2/tb/daten/projects/git/tb/t/trash directory.t7514-file-watcher-lib

Could we use relative path names internally, relative to $GIT_DIR ?


---
Another thing:
Compiling under Mingw gives this:
LINK git-credential-store.exe
libgit.a(file-watcher-lib.o): In function `connect_watcher':
c:\Dokumente und Einstellungen\tb\projects\git\tb/file-watcher-lib.c:21: 
undefined reference to `unix_stream_connect'
collect2: ld returned 1 exit status
make: *** [git-credential-store.exe] Error 1

We may need a compiler option like HAS_UNIX_SOCKETS or so.

--
+++ b/file-watcher.c

+#define INOTIFY_MASKS (IN_DELETE_SELF | IN_MOVE_SELF | \
+  IN_CREATE | IN_ATTRIB | IN_DELETE | IN_MODIFY |  \
+  IN_MOVED_FROM | IN_MOVED_TO)
This feels confusing:
a) we have inotify_masks with lower case below.
b) how about INOTIFY_NEEDED_BITS ?
---




I'm OK with having the protocol having specified in the
test cases.
One thing that I have on the wish list is to make the
commands/responses more unique, to be able to run grep
on the code base.

One idea could be to use a prefix
fwr for file watcher request or
fwr for file watcher response.
This does not work, hihi, so

fwq for file watcher reQuest and
fwe for file watcher rEsponse.
Or 
ffw as from file watcher and
tfw as to file watcher for the people who have problems
with left and right,  and  could work.

This is all for today.
I will have a look at different error scenarios, what happens
when the watcher crashes and needs to be restarted,
or when Git itself dies with a segfault and doesn't tell the
watcher.

The easiest way to simulate this would be in terms of test cases.
So I will try to write some
/Torsten
 



--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] fast-import.c: always honor the filename case

2014-02-09 Thread Torsten Bögershausen
On 2014-02-06 12.24, Reuben Hawkins wrote:
[snipped away minor interesting stuff]

Reading the answers from Peff and Junio, I am convinced that the 
fast-import should
not look at core.ignorecase at all.


Agreed, but my patch 0001-fast-import.c-ignorecase-iff-... is working very well 
(for me anyway), and the ignore-case option may be useful to the git-p4 
importer (which I guess is something that should be determined for sure).

If you want, you can turn this into a real patch and send it to the list.
I think  Pete Wyckoff p...@padd.com is one of the experts about p4.

And the same is for fast-export fixes you have made: If you have the time,
convert it into a patch and send it to the list.

[]
 BTW, if you can, can you give me a quick overview of testing it git?  I can 
 run 'make tests' easy enough, but there seems to be a well defined framework 
 of testing written in bash and c..  Is there a doc on that framework anywhere?
I'm not sure if there is a document, and yes, it's a nice framework.
You can have a look at t0050, it gives a good overview over the most important
feattures in the framework, I would say.

(And the shell scripts uses a subset of the POSIX shell, which means we avoid
bash-ism things like [[ ]] or ==)
/Torsten

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 0/9] add --gpg-sign to rebase and pull

2014-02-09 Thread brian m. carlson
This series was posted to the list some time back.  This is a re-send of
Nicolas Vigier's work with an additional patch that adds --gpg-sign to
pull as well, as well as the fixes that Junio suggested in review for
v3.

There is also one additional merge call that was not previously given a
signature option that is now provided one.  I believe this was an
oversight, so I fixed it.

The major change in this version is fixed quoting for the arguments.
All the quoting should now be correct.  I reverted the change that
placed quoting around only the argument to -S, as this was too difficult
to get consistently right and nobody objected to '-S1F52F68B!' as being
too ugly to display to the user.

Nicolas Vigier (8):
  cherry-pick, revert: add the --gpg-sign option
  git-sh-setup.sh: add variable to use the stuck-long mode
  am: parse options in stuck-long mode
  am: add the --gpg-sign option
  rebase: remove useless arguments check
  rebase: don't try to match -M option
  rebase: parse options in stuck-long mode
  rebase: add the --gpg-sign option

brian m. carlson (1):
  pull: add the --gpg-sign option.

 Documentation/git-am.txt  |  6 +++-
 Documentation/git-cherry-pick.txt |  7 -
 Documentation/git-rebase.txt  |  4 +++
 Documentation/git-revert.txt  |  6 +++-
 builtin/revert.c  |  2 ++
 contrib/git-resurrect.sh  |  1 +
 git-am.sh | 26 ++--
 git-instaweb.sh   |  1 +
 git-pull.sh   | 13 +++-
 git-quiltimport.sh|  1 +
 git-rebase--am.sh |  8 +++--
 git-rebase--interactive.sh| 39 
 git-rebase--merge.sh  |  2 +-
 git-rebase.sh | 62 +--
 git-request-pull.sh   |  1 +
 git-sh-setup.sh   |  2 ++
 sequencer.c   | 11 +++
 sequencer.h   |  2 ++
 18 files changed, 135 insertions(+), 59 deletions(-)

-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 3/9] am: parse options in stuck-long mode

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

There is no functional change. The reason for this change is to be able
to add a new option taking an optional argument.

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 git-am.sh | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index a3b6f98..020abf6 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -4,7 +4,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
-OPTIONS_STUCKLONG=
+OPTIONS_STUCKLONG=t
 OPTIONS_SPEC=\
 git am [options] [(mbox|Maildir)...]
 git am [options] (--continue | --skip | --abort)
@@ -414,14 +414,14 @@ it will be removed. Please do not use it anymore.
abort=t ;;
--rebasing)
rebasing=t threeway=t ;;
-   --resolvemsg)
-   shift; resolvemsg=$1 ;;
-   --whitespace|--directory|--exclude|--include)
-   git_apply_opt=$git_apply_opt $(sq $1=$2); shift ;;
-   -C|-p)
-   git_apply_opt=$git_apply_opt $(sq $1$2); shift ;;
-   --patch-format)
-   shift ; patch_format=$1 ;;
+   --resolvemsg=*)
+   resolvemsg=${1#--resolvemsg=} ;;
+   --whitespace=*|--directory=*|--exclude=*|--include=*)
+   git_apply_opt=$git_apply_opt $(sq $1) ;;
+   -C*|-p*)
+   git_apply_opt=$git_apply_opt $(sq $1) ;;
+   --patch-format=*)
+   patch_format=${1#--patch-format=} ;;
--reject|--ignore-whitespace|--ignore-space-change)
git_apply_opt=$git_apply_opt $1 ;;
--committer-date-is-author-date)
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 6/9] rebase: don't try to match -M option

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

The -M option does not exist in OPTIONS_SPEC, so there is no use to try
to find it.

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 git-rebase.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index d1835ba..3b55211 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -267,7 +267,7 @@ do
--no-fork-point)
fork_point=
;;
-   -M|-m)
+   -m)
do_merge=t
;;
-X)
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 2/9] git-sh-setup.sh: add variable to use the stuck-long mode

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

If the variable $OPTIONS_STUCKLONG is not empty, then rev-parse
option parsing is done in --stuck-long mode.

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 contrib/git-resurrect.sh | 1 +
 git-am.sh| 1 +
 git-instaweb.sh  | 1 +
 git-quiltimport.sh   | 1 +
 git-rebase.sh| 1 +
 git-request-pull.sh  | 1 +
 git-sh-setup.sh  | 2 ++
 7 files changed, 8 insertions(+)

diff --git a/contrib/git-resurrect.sh b/contrib/git-resurrect.sh
index a4ed4c3..d7e97bb 100755
--- a/contrib/git-resurrect.sh
+++ b/contrib/git-resurrect.sh
@@ -10,6 +10,7 @@ is rather slow but allows you to resurrect other people's 
topic
 branches.
 
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC=\
 git resurrect $USAGE
 --
diff --git a/git-am.sh b/git-am.sh
index bbea430..a3b6f98 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -4,6 +4,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC=\
 git am [options] [(mbox|Maildir)...]
 git am [options] (--continue | --skip | --abort)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index e93a238..4aa3eb8 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -5,6 +5,7 @@
 
 PERL='@@PERL@@'
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC=\
 git instaweb [options] (--start | --stop | --restart)
 --
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 8e17525..167d79f 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC=\
 git quiltimport [options]
 --
diff --git a/git-rebase.sh b/git-rebase.sh
index 8a3efa2..c1f98ae 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -5,6 +5,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC=\
 git rebase [-i] [options] [--exec cmd] [--onto newbase] [upstream] 
[branch]
 git rebase [-i] [options] [--exec cmd] [--onto newbase] --root [branch]
diff --git a/git-request-pull.sh b/git-request-pull.sh
index fe21d5d..cf4f150 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -9,6 +9,7 @@ LONG_USAGE='Summarizes the changes between two commits to the 
standard output,
 and includes the given URL in the generated summary.'
 SUBDIRECTORY_OK='Yes'
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC='git request-pull [options] start url [end]
 --
 pshow patch text as well
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index fffa3c7..5f28b32 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -72,6 +72,8 @@ if test -n $OPTIONS_SPEC; then
parseopt_extra=
[ -n $OPTIONS_KEEPDASHDASH ] 
parseopt_extra=--keep-dashdash
+   [ -n $OPTIONS_STUCKLONG ] 
+   parseopt_extra=$parseopt_extra --stuck-long
 
eval $(
echo $OPTIONS_SPEC |
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 4/9] am: add the --gpg-sign option

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 Documentation/git-am.txt | 6 +-
 git-am.sh| 9 -
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 54d8461..17924d0 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -14,7 +14,7 @@ SYNOPSIS
 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
 [--whitespace=option] [-Cn] [-pn] [--directory=dir]
 [--exclude=path] [--include=path] [--reject] [-q | --quiet]
-[--[no-]scissors]
+[--[no-]scissors] [-S[keyid]]
 [(mbox | Maildir)...]
 'git am' (--continue | --skip | --abort)
 
@@ -119,6 +119,10 @@ default.   You can use `--no-utf8` to override this.
Skip the current patch.  This is only meaningful when
restarting an aborted patch.
 
+-S[keyid]::
+--gpg-sign[=keyid]::
+   GPG-sign commits.
+
 --continue::
 -r::
 --resolved::
diff --git a/git-am.sh b/git-am.sh
index 020abf6..78517f2 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -38,6 +38,7 @@ abort   restore the original branch and abort the 
patching operation.
 committer-date-is-author-datelie about committer date
 ignore-date use current timestamp for author date
 rerere-autoupdate update the index with reused conflict resolution if possible
+S,gpg-sign? GPG-sign commits
 rebasing*   (internal use for git-rebase)
 
 . git-sh-setup
@@ -375,6 +376,7 @@ git_apply_opt=
 committer_date_is_author_date=
 ignore_date=
 allow_rerere_autoupdate=
+gpg_sign_opt=
 
 if test $(git config --bool --get am.keepcr) = true
 then
@@ -436,6 +438,10 @@ it will be removed. Please do not use it anymore.
keepcr=t ;;
--no-keep-cr)
keepcr=f ;;
+   --gpg-sign)
+   gpg_sign_opt=-S ;;
+   --gpg-sign=*)
+   gpg_sign_opt=-S${1#--gpg-sign=} ;;
--)
shift; break ;;
*)
@@ -900,7 +906,8 @@ did you forget to use 'git add'?
GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE
export GIT_COMMITTER_DATE
fi 
-   git commit-tree $tree ${parent:+-p} $parent 
$dotest/final-commit
+   git commit-tree ${parent:+-p} $parent 
${gpg_sign_opt:+$gpg_sign_opt} $tree  \
+   $dotest/final-commit
) 
git update-ref -m $GIT_REFLOG_ACTION: $FIRSTLINE HEAD $commit $parent 
||
stop_here $this
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 9/9] pull: add the --gpg-sign option.

2014-02-09 Thread brian m. carlson
git merge already allows us to sign commits, and git rebase has recently
learned how to do so as well.  Teach git pull to parse the -S/--gpg-sign
option and pass this along to merge or rebase, as appropriate.

Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 git-pull.sh | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/git-pull.sh b/git-pull.sh
index 0a5aa2c..6986e0f 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -138,6 +138,15 @@ do
--no-verify-signatures)
verify_signatures=--no-verify-signatures
;;
+   --gpg-sign|-S)
+   gpg_sign_args=-S
+   ;;
+   --gpg-sign=*)
+   gpg_sign_args=$(git rev-parse --sq-quote -S${1#--gpg-sign=})
+   ;;
+   -S*)
+   gpg_sign_args=$(git rev-parse --sq-quote $1)
+   ;;
--d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
dry_run=--dry-run
;;
@@ -305,11 +314,13 @@ merge_name=$(git fmt-merge-msg $log_arg 
$GIT_DIR/FETCH_HEAD) || exit
 case $rebase in
 true)
eval=git-rebase $diffstat $strategy_args $merge_args $rebase_args 
$verbosity
+   eval=$eval $gpg_sign_args
eval=$eval --onto $merge_head ${oldremoteref:-$merge_head}
;;
 *)
eval=git-merge $diffstat $no_commit $verify_signatures $edit $squash 
$no_ff $ff_only
-   eval=$eval  $log_arg $strategy_args $merge_args $verbosity $progress
+   eval=$eval $log_arg $strategy_args $merge_args $verbosity $progress
+   eval=$eval $gpg_sign_args
eval=$eval \\$merge_name\ HEAD $merge_head
;;
 esac
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 5/9] rebase: remove useless arguments check

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

Remove a check on the number of arguments for --onto and -x options.
It is not possible for $# to be = 2 at this point :

 - if --onto or -x has an argument, git rev-parse --parseopt will
   provide something like this :
 set -- --onto 'x' --
   when parsing the --onto option, $# will be 3 or more if there are
   other options.

 - if --onto or -x doesn't have an argument, git rev-parse --parseopt
   will exit with an error and display usage information.

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 git-rebase.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index c1f98ae..d1835ba 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -238,12 +238,10 @@ do
action=${1##--}
;;
--onto)
-   test 2 -le $# || usage
onto=$2
shift
;;
-x)
-   test 2 -le $# || usage
cmd=${cmd}exec $2${LF}
shift
;;
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/9] cherry-pick, revert: add the --gpg-sign option

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 Documentation/git-cherry-pick.txt |  7 ++-
 Documentation/git-revert.txt  |  6 +-
 builtin/revert.c  |  2 ++
 sequencer.c   | 11 +++
 sequencer.h   |  2 ++
 5 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-cherry-pick.txt 
b/Documentation/git-cherry-pick.txt
index c205d23..f1e6b2f 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -8,7 +8,8 @@ git-cherry-pick - Apply the changes introduced by some existing 
commits
 SYNOPSIS
 
 [verse]
-'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] commit...
+'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
+ [-S[keyid]] commit...
 'git cherry-pick' --continue
 'git cherry-pick' --quit
 'git cherry-pick' --abort
@@ -100,6 +101,10 @@ effect to your index in a row.
 --signoff::
Add Signed-off-by line at the end of the commit message.
 
+-S[keyid]::
+--gpg-sign[=keyid]::
+   GPG-sign commits.
+
 --ff::
If the current HEAD is the same as the parent of the
cherry-pick'ed commit, then a fast forward to this commit will
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 2de67a5..9eb83f0 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -8,7 +8,7 @@ git-revert - Revert some existing commits
 SYNOPSIS
 
 [verse]
-'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] commit...
+'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[keyid]] 
commit...
 'git revert' --continue
 'git revert' --quit
 'git revert' --abort
@@ -80,6 +80,10 @@ more details.
 This is useful when reverting more than one commits'
 effect to your index in a row.
 
+-S[keyid]::
+--gpg-sign[=keyid]::
+   GPG-sign commits.
+
 -s::
 --signoff::
Add Signed-off-by line at the end of the commit message.
diff --git a/builtin/revert.c b/builtin/revert.c
index 87659c9..065d88d 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -89,6 +89,8 @@ static void parse_args(int argc, const char **argv, struct 
replay_opts *opts)
OPT_STRING(0, strategy, opts-strategy, N_(strategy), 
N_(merge strategy)),
OPT_CALLBACK('X', strategy-option, opts, N_(option),
N_(option for merge strategy), option_parse_x),
+   { OPTION_STRING, 'S', gpg-sign, opts-gpg_sign, N_(key id),
+ N_(GPG sign commit), PARSE_OPT_OPTARG, NULL, (intptr_t)  
},
OPT_END(),
OPT_END(),
OPT_END(),
diff --git a/sequencer.c b/sequencer.c
index 90cac7b..bde5f04 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -392,11 +392,18 @@ static int run_git_commit(const char *defmsg, struct 
replay_opts *opts,
 {
struct argv_array array;
int rc;
+   char *gpg_sign;
 
argv_array_init(array);
argv_array_push(array, commit);
argv_array_push(array, -n);
 
+   if (opts-gpg_sign) {
+   gpg_sign = xmalloc(3 + strlen(opts-gpg_sign));
+   sprintf(gpg_sign, -S%s, opts-gpg_sign);
+   argv_array_push(array, gpg_sign);
+   free(gpg_sign);
+   }
if (opts-signoff)
argv_array_push(array, -s);
if (!opts-edit) {
@@ -808,6 +815,8 @@ static int populate_opts_cb(const char *key, const char 
*value, void *data)
opts-mainline = git_config_int(key, value);
else if (!strcmp(key, options.strategy))
git_config_string(opts-strategy, key, value);
+   else if (!strcmp(key, options.gpg-sign))
+   git_config_string(opts-gpg_sign, key, value);
else if (!strcmp(key, options.strategy-option)) {
ALLOC_GROW(opts-xopts, opts-xopts_nr + 1, opts-xopts_alloc);
opts-xopts[opts-xopts_nr++] = xstrdup(value);
@@ -981,6 +990,8 @@ static void save_opts(struct replay_opts *opts)
}
if (opts-strategy)
git_config_set_in_file(opts_file, options.strategy, 
opts-strategy);
+   if (opts-gpg_sign)
+   git_config_set_in_file(opts_file, options.gpg-sign, 
opts-gpg_sign);
if (opts-xopts) {
int i;
for (i = 0; i  opts-xopts_nr; i++)
diff --git a/sequencer.h b/sequencer.h
index 1fc22dc..db43e9c 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -37,6 +37,8 @@ struct replay_opts {
 
int mainline;
 
+   const char *gpg_sign;
+
/* Merge strategy */
const char *strategy;
const char **xopts;
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  

[PATCH v4 8/9] rebase: add the --gpg-sign option

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 Documentation/git-rebase.txt |  4 
 git-rebase--am.sh|  8 +---
 git-rebase--interactive.sh   | 39 ++-
 git-rebase--merge.sh |  2 +-
 git-rebase.sh| 11 +++
 5 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 2889be6..2a93c64 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -281,6 +281,10 @@ which makes little sense.
specified, `-s recursive`.  Note the reversal of 'ours' and
'theirs' as noted above for the `-m` option.
 
+-S[keyid]::
+--gpg-sign[=keyid]::
+   GPG-sign commits.
+
 -q::
 --quiet::
Be quiet. Implies --no-stat.
diff --git a/git-rebase--am.sh b/git-rebase--am.sh
index a4f683a..df46f4c 100644
--- a/git-rebase--am.sh
+++ b/git-rebase--am.sh
@@ -6,7 +6,8 @@
 
 case $action in
 continue)
-   git am --resolved --resolvemsg=$resolvemsg 
+   git am --resolved --resolvemsg=$resolvemsg \
+   ${gpg_sign_opt:+$gpg_sign_opt} 
move_to_original_branch
return
;;
@@ -26,7 +27,7 @@ then
# empty commits and even if it didn't the format doesn't really lend
# itself well to recording empty patches.  fortunately, cherry-pick
# makes this easy
-   git cherry-pick --allow-empty $revisions
+   git cherry-pick ${gpg_sign_opt:+$gpg_sign_opt} --allow-empty 
$revisions
ret=$?
 else
rm -f $GIT_DIR/rebased-patches
@@ -60,7 +61,8 @@ else
return $?
fi
 
-   git am $git_am_opt --rebasing --resolvemsg=$resolvemsg 
$GIT_DIR/rebased-patches
+   git am $git_am_opt --rebasing --resolvemsg=$resolvemsg \
+   ${gpg_sign_opt:+$gpg_sign_opt} $GIT_DIR/rebased-patches
ret=$?
 
rm -f $GIT_DIR/rebased-patches
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 43c19e0..a1adae8 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -179,9 +179,10 @@ exit_with_patch () {
echo $1  $state_dir/stopped-sha
make_patch $1
git rev-parse --verify HEAD  $amend
+   gpg_sign_opt_quoted=${gpg_sign_opt:+$(git rev-parse --sq-quote 
$gpg_sign_opt)}
warn You can amend the commit now, with
warn
-   warn   git commit --amend
+   warn   git commit --amend $gpg_sign_opt_quoted
warn
warn Once you are satisfied with your changes, run
warn
@@ -248,7 +249,9 @@ pick_one () {
 
test -d $rewritten 
pick_one_preserving_merges $@  return
-   output eval git cherry-pick $strategy_args $empty_args $ff $@
+   output eval git cherry-pick \
+   ${gpg_sign_opt:+$(git rev-parse --sq-quote 
$gpg_sign_opt)} \
+   $strategy_args $empty_args $ff $@
 }
 
 pick_one_preserving_merges () {
@@ -351,7 +354,8 @@ pick_one_preserving_merges () {
new_parents=${new_parents# $first_parent}
merge_args=--no-log --no-ff
if ! do_with_author output eval \
-   'git merge $merge_args $strategy_args -m $msg_content 
$new_parents'
+   'git merge ${gpg_sign_opt:+$gpg_sign_opt} \
+   $merge_args $strategy_args -m $msg_content 
$new_parents'
then
printf %s\n $msg_content  
$GIT_DIR/MERGE_MSG
die_with_patch $sha1 Error redoing merge $sha1
@@ -359,7 +363,9 @@ pick_one_preserving_merges () {
echo $sha1 $(git rev-parse HEAD^0)  
$rewritten_list
;;
*)
-   output eval git cherry-pick $strategy_args $@ ||
+   output eval git cherry-pick \
+   ${gpg_sign_opt:+$(git rev-parse --sq-quote 
$gpg_sign_opt)} \
+   $strategy_args $@ ||
die_with_patch $sha1 Could not pick $sha1
;;
esac
@@ -470,7 +476,8 @@ do_pick () {
   --no-post-rewrite -n -q -C $1 
pick_one -n $1 
git commit --allow-empty --allow-empty-message \
-  --amend --no-post-rewrite -n -q -C $1 ||
+  --amend --no-post-rewrite -n -q -C $1 \
+  ${gpg_sign_opt:+$gpg_sign_opt} ||
die_with_patch $1 Could not apply $1... $2
else
pick_one $1 ||
@@ -497,7 +504,7 @@ do_next () {
 
mark_action_done
do_pick $sha1 $rest
-   git commit --amend 

[PATCH v4 7/9] rebase: parse options in stuck-long mode

2014-02-09 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

There is no functionnal change. The reason for this change is to be able
to add a new option taking an optional argument.

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 git-rebase.sh | 50 ++
 1 file changed, 22 insertions(+), 28 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 3b55211..842d7d4 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -5,7 +5,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
-OPTIONS_STUCKLONG=
+OPTIONS_STUCKLONG=t
 OPTIONS_SPEC=\
 git rebase [-i] [options] [--exec cmd] [--onto newbase] [upstream] 
[branch]
 git rebase [-i] [options] [--exec cmd] [--onto newbase] --root [branch]
@@ -237,21 +237,19 @@ do
test $total_argc -eq 2 || usage
action=${1##--}
;;
-   --onto)
-   onto=$2
-   shift
+   --onto=*)
+   onto=${1#--onto=}
;;
-   -x)
-   cmd=${cmd}exec $2${LF}
-   shift
+   --exec=*)
+   cmd=${cmd}exec ${1#--exec=}${LF}
;;
-   -i)
+   --interactive)
interactive_rebase=explicit
;;
-   -k)
+   --keep-empty)
keep_empty=yes
;;
-   -p)
+   --preserve-merges)
preserve_merges=t
test -z $interactive_rebase  interactive_rebase=implied
;;
@@ -267,21 +265,19 @@ do
--no-fork-point)
fork_point=
;;
-   -m)
+   --merge)
do_merge=t
;;
-   -X)
-   shift
-   strategy_opts=$strategy_opts $(git rev-parse --sq-quote 
--$1)
+   --strategy-option=*)
+   strategy_opts=$strategy_opts $(git rev-parse --sq-quote 
--${1#--strategy-option=})
do_merge=t
test -z $strategy  strategy=recursive
;;
-   -s)
-   shift
-   strategy=$1
+   --strategy=*)
+   strategy=${1#--strategy=}
do_merge=t
;;
-   -n)
+   --no-stat)
diffstat=
;;
--stat)
@@ -290,21 +286,20 @@ do
--autostash)
autostash=true
;;
-   -v)
+   --verbose)
verbose=t
diffstat=t
GIT_QUIET=
;;
-   -q)
+   --quiet)
GIT_QUIET=t
git_am_opt=$git_am_opt -q
verbose=
diffstat=
;;
-   --whitespace)
-   shift
-   git_am_opt=$git_am_opt --whitespace=$1
-   case $1 in
+   --whitespace=*)
+   git_am_opt=$git_am_opt --whitespace=${1#--whitespace=}
+   case ${1#--whitespace=} in
fix|strip)
force_rebase=t
;;
@@ -317,14 +312,13 @@ do
git_am_opt=$git_am_opt $1
force_rebase=t
;;
-   -C)
-   shift
-   git_am_opt=$git_am_opt -C$1
+   -C*)
+   git_am_opt=$git_am_opt $1
;;
--root)
rebase_root=t
;;
-   -f|--no-ff)
+   --force-rebase|--no-ff)
force_rebase=t
;;
--rerere-autoupdate|--no-rerere-autoupdate)
-- 
1.9.0.rc3.1008.gd08b47c.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 12/13] Makefile: teach scripts to include make variables

2014-02-09 Thread Jeff King
On Sat, Feb 08, 2014 at 10:47:16PM +0100, Thomas Rast wrote:

 Jeff King p...@peff.net writes:
 
  The current scheme for getting build-time variables into a
  shell script is to munge the script with sed, and stick the
  munged variable into a special sentinel file so that make
  knows about the dependency.
 
  Instead, we can combine both functions by generating a shell
  snippet with our value, and then building shell scripts by
  concatenating their snippets. make then handles the
  dependency automatically, and it's easy to generate tighter
  dependencies.
 
  We demonstrate here by moving the DIFF substitution into
  its own snippet, which lets us rebuild only the single
  affected file when it changes.
 
 I can't look right now *why* this happens, but this breaks
 ./t2300-cd-to-toplevel.sh --valgrind with messages like

I think it's the bug that Junio already pointed out; git-sh-setup gets
the DIFF=... snippet instead of the initial #!-line. I didn't look at
the details, but that probably screws up valgrind's symlinking, since we
no longer realize it's a shell script.

Once that bug is fixed, I'll double-check that the problem goes away.

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Jeff King
On Sun, Feb 09, 2014 at 06:48:18AM +0700, Duy Nguyen wrote:

  I guess by quoting you meant:
 
echo 'trailing  ' .gitignore
 
 This makes  special. If we follow shell convention then things
 between .. should be literal (e.g. * is no longer a wildcard). We
 don't support it yet. So I rather go with backslash as it adds less
 code.

For some reason I was thinking that we already handled double-quotes
here (as we do in other places where quoting is optional). But it looks
like we don't currently, so yeah, I don't think it is worth adding due
to the potential confusion.

Backslash-escaping was what I had originally assumed you meant, and it
was, so we are all on the same page (the patch was just broken. ;) ).

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy  pclo...@gmail.com writes:

 Trailing spaces are invisible in most standard editors (*). git diff
 does show trailing spaces by default. But that does not help newly
 written .gitignore files. And trailing spaces are the source of
 frustration when writing .gitignore.

 So let's ignore them. Nobody sane would put a trailing space in file
 names. But we could be careful and do it in two steps: warn first,
 then ignore trailing spaces. Another option is merge two patches in
 one and be done with it.

 People can still quote trailing spaces, which will not be ignored (and
 much more visible). Quoting comes with a cost of doing fnmatch(). But

Hmph, sorry but I fail to see why we need to incur cost for
fnmatch().  We read and parse the file and keep them as internal
strings, so your unquoting (and complaining the unquoted trailng
spaces) can be done at the parse time, while keeping the trailing
spaces the user explicitly told us to keep by quoting in the
internal string that we eventually feed fnmatch() with _after_
unquoting, no?

Puzzled...

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Duy Nguyen
On Mon, Feb 10, 2014 at 11:07 AM, Junio C Hamano gits...@pobox.com wrote:
 Nguyễn Thái Ngọc Duy  pclo...@gmail.com writes:

 Trailing spaces are invisible in most standard editors (*). git diff
 does show trailing spaces by default. But that does not help newly
 written .gitignore files. And trailing spaces are the source of
 frustration when writing .gitignore.

 So let's ignore them. Nobody sane would put a trailing space in file
 names. But we could be careful and do it in two steps: warn first,
 then ignore trailing spaces. Another option is merge two patches in
 one and be done with it.

 People can still quote trailing spaces, which will not be ignored (and
 much more visible). Quoting comes with a cost of doing fnmatch(). But

 Hmph, sorry but I fail to see why we need to incur cost for
 fnmatch().  We read and parse the file and keep them as internal
 strings, so your unquoting (and complaining the unquoted trailng
 spaces) can be done at the parse time, while keeping the trailing
 spaces the user explicitly told us to keep by quoting in the
 internal string that we eventually feed fnmatch() with _after_
 unquoting, no?

That's the optimization in the but sentence. Another (off topic)
opt. we could do is make *.[ch] behave more like *.c, where we
just try to match the tail part.
-- 
Duy
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes:

 Nguyễn Thái Ngọc Duy  pclo...@gmail.com writes:

 Trailing spaces are invisible in most standard editors (*). git diff
 does show trailing spaces by default. But that does not help newly
 written .gitignore files. And trailing spaces are the source of
 frustration when writing .gitignore.

 So let's ignore them. Nobody sane would put a trailing space in file
 names. But we could be careful and do it in two steps: warn first,
 then ignore trailing spaces. Another option is merge two patches in
 one and be done with it.

 People can still quote trailing spaces, which will not be ignored (and
 much more visible). Quoting comes with a cost of doing fnmatch(). But

 Hmph, sorry but I fail to see why we need to incur cost for
 fnmatch().  We read and parse the file and keep them as internal
 strings, so your unquoting (and complaining the unquoted trailng
 spaces) can be done at the parse time, while keeping the trailing
 spaces the user explicitly told us to keep by quoting in the
 internal string that we eventually feed fnmatch() with _after_
 unquoting, no?

 Puzzled...

Heh, silly me. Yes, we _could_ parse and strip \  into   if we
wanted to, but we can just give \  and let fnmatch(3) do its
thing, and that is the right thing to do for a rare corner case like
this (i.e. deliberate trailing spaces).

So I think I understand your reasoning, and I agree with it.

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 7/9] rebase: parse options in stuck-long mode

2014-02-09 Thread Eric Sunshine
On Sun, Feb 9, 2014 at 8:03 PM, brian m. carlson
sand...@crustytoothpaste.net wrote:
 From: Nicolas Vigier bo...@mars-attacks.org

 There is no functionnal change. The reason for this change is to be able

s/functionnal/functional/

 to add a new option taking an optional argument.

 Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
 Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 14/14] Documentation: add documentation for 'git interpret-trailers'

2014-02-09 Thread Eric Sunshine
On Thu, Feb 6, 2014 at 3:20 PM, Christian Couder
chrisc...@tuxfamily.org wrote:
 Signed-off-by: Christian Couder chrisc...@tuxfamily.org
 ---
 diff --git a/Documentation/git-interpret-trailers.txt 
 b/Documentation/git-interpret-trailers.txt
 new file mode 100644
 index 000..0617941
 --- /dev/null
 +++ b/Documentation/git-interpret-trailers.txt
 @@ -0,0 +1,132 @@
 +OPTIONS
 +---
 +--trim-empty::
 +   If the 'value' part of any trailer contains only whitespace,
 +   the whole trailer will be removed from the resulting message.
 +
 +infile=file::
 +   Read the commit message from `file` instead of the standard
 +   input.

s//--/

 +
 +CONFIGURATION VARIABLES
 +---
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 01/14] Add data structures and basic functions for commit trailers

2014-02-09 Thread Eric Sunshine
On Sun, Feb 9, 2014 at 8:48 AM, Christian Couder
chrisc...@tuxfamily.org wrote:
 From: Junio C Hamano gits...@pobox.com

 Christian Couder chrisc...@tuxfamily.org writes:

 +static inline int same_trailer(struct trailer_item *a, struct trailer_item 
 *b, int alnum_len)
 +{
 +return same_token(a, b, alnum_len)  same_value(a, b);
 +}

 All these inlines look premature optimization that can be
 delegated to any decent compiler, don't they?

 Yeah, but as Eric suggested to add them like in header files and you
 did not reply to him, I thought you agreed with him.
 I will remove them.

If these functions are used only by trailer.c, then it would make
sense to move them from trailer.h to trailer.c so that they don't get
defined unnecessarily by each .c file which includes trailer.h.

 +/* Get the length of buf from its beginning until its last alphanumeric 
 character */
 +static inline size_t alnum_len(const char *buf, int len)
 +{
 +while (--len = 0  !isalnum(buf[len]));
 +return (size_t) len + 1;

 This is somewhat unfortunate.  if the caller wants to receive
 size_t, perhaps it should be passing in size_t (or ssize_t) to the
 function?  Hard to guess without an actual caller, though.

 Ok, I will make it return an int.

Why not adjust the loop condition slightly instead so that you can
continue to accept and return size_t?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Fwd: Git Directory Diff for submodule

2014-02-09 Thread Gábor Lipták
Hi Jens,

So git status says:

liptak@liptak-kubuntu:~/Projects/MAIN_MODULE/platform/SUBMODULE
[master]$ git status
# On branch master
# Your branch is up-to-date with 'origin/master'.
#
# Changes not staged for commit:
#   (use git add file... to update what will be committed)
#   (use git checkout -- file... to discard changes in working
directory)
#
#   modified:   xx.java
#   modified:   xxx.java
# ...
# ...
# ...
# ...
# ...
#
no changes added to commit (use git add and/or git commit -a)

git config core.worktree gives back: ../../../../platform/SUBMODULE

The submodule was inited simply with git submodule init +
git.submodule update

MAINMODULE/.gitsubmodules file contains similar entry:
[submodule platform/SUBMODULE]
path = platform/SUBMODULE
url = ssh://git@somehost/foo/bar.git

MAINMODULE/.git/config:
[submodule platform/SUBMODULE]
url = ssh://git@somehost/foo/bar.git

MAINMODULE/platform/SUBMODULE/.git:
gitdir: ../../.git/modules/platform/SUBMODULE

MAINMODULE/.git/modules/platform/SUBMODULE/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
worktree = ../../../../platform/SUBMODULE
[remote origin]
url = ssh://git@somehost/foo/bar.git
fetch = +refs/heads/*:refs/remotes/origin/*

So for me it seems that somehow the relative path inside
MAINMODULE/.git/modules/platform/SUBMODULE/config gets configuread
wrong during submodule init+update.

I tried to update the
MAINMODULE/.git/modules/platform/SUBMODULE/config to contain
../../platform/SUBMODULE as worktree path, then meld was correctly
started, but the compare tree was not usable. For file changes it
displayed always: X.java: Dangling symlink. So this is still not a
complete solution somehow.

Regards,

Gábor Lipták

2014-02-07 Jens Lehmann jens.lehm...@web.de:
 Am 07.02.2014 10:15, schrieb Gábor Lipták:
 I think I have found a bug related to submodules and directory diff.
 See the details at hXXp://stackoverflow.com/q/21623155/337621.

 Let's inline the recipe one finds after decrypting this link:

 ~/Projects/MAINMODULE/platform/SUBMODULE [master]$ git difftool -tool=meld 
 --dir-diff --cached
   fatal: Could not switch to '../../../../platform/': No such file or 
 directory
   diff --raw --no-abbrev -z --cached: command returned error: 128
 ~/Projects/MAINMODULE/platform/SUBMODULE [master]$ cd ..
 ~/Projects/MAINMODULE/platform [master]$ cd ..
 ~/Projects/MAINMODULE [master]$ git difftool -tool=meld --dir-diff --cached
   // NO PROBLEM, works.
 ~/Projects/MAINMODULE [master]$ git version
   git version 1.8.4


 If you need any further details, just ask.

 - Does this only happen when you use difftool? E.g. what does
   git status inside the submodule say?

 - What does git config core.worktree print when run in the
   submodule?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html