Re: [PATCH] remote: unify main and subcommand usage strings
2013/11/3 Thomas Rast t...@thomasrast.ch: We had separate usages for each subcommand, and for the main command, even though the latter is essentially a concatenation of all of the former. This leads to a lot of duplication and unnecessary differences, e.g., in the 'set-head' case the two strings differ only in a space. Unify the strings in the usages by putting each of them in a variable, and assembling the usage arrays from them. Note that this patch changes the usage strings for the following subcommands: - prune and show: the individual usage only said [options]. Kept the snippet from the main usage, which is more specific. - set-branches: kept the main usage, which is more concise in saying that --add is optional Differences of git-remote usages after applied your patch. diff -u before/git-remote-add-usage after/git-remote-add-usage --- before/git-remote-add-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-add-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote add [options] name url +usage: git remote add [-t branch] [-m master] [-f] [--tags|--no-tags] [--mirror=fetch|push] name url -f, --fetch fetch the remote branches --tagsimport all tags and associated objects when fetching diff -u before/git-remote-prune-usage after/git-remote-prune-usage --- before/git-remote-prune-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-prune-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote prune [options] name +usage: git remote prune [-n | --dry-run] name -n, --dry-run dry run diff -u before/git-remote-set-branches-usage after/git-remote-set-branches-usage --- before/git-remote-set-branches-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-set-branches-usage 2013-11-03 15:11:32.0 +0800 @@ -1,5 +1,4 @@ -usage: git remote set-branches name branch... - or: git remote set-branches --add name branch... +usage: git remote set-branches [--add] name branch... --add add branch diff -u before/git-remote-show-usage after/git-remote-show-usage --- before/git-remote-show-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-show-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote show [options] name +usage: git remote [-v | --verbose] show [-n] name -ndo not query remotes diff -u before/git-remote-update-usage after/git-remote-update-usage --- before/git-remote-update-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-update-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote update [options] [group | remote]... +usage: git remote [-v | --verbose] update [-p | --prune] [(group | remote)...] -p, --prune prune remotes after fetching -- Jiang Xin -- 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: Re* [BUG?] error: cache entry has null sha1
On Fri, Nov 01, 2013 at 03:44:52PM -0700, Junio C Hamano wrote: Here is a proposed endgame for the topic in a patch form, then. I've added a test for low-level read-tree --reset -u A B, and tried the am --abort I saw the problem with manually, but other than that, I haven't (re)thought about the issue hard enough to be comfortable with this change yet. Thanks for moving this forward. I read over the old discussion and the patches, and I think the patch is a good thing. There was some question from me earlier on whether there were other cases we weren't considering. The discussion convinced me that there almost certainly aren't. And even if there are, this is still the right direction. Writing out a bogus CE_CONFLICTED entry is _certainly_ wrong, so even if we do not get the details right (e.g., rejecting a merge we should be accepting), this patch still forms a base for further fixups. Jeff King (1): unpack-trees: fix read-tree -u --reset A B with conflicted index My missing signoff: Signed-off-by: Jeff King p...@peff.net -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] remote: unify main and subcommand usage strings
2013/11/3 Jiang Xin worldhello@gmail.com: 2013/11/3 Thomas Rast t...@thomasrast.ch: Note that this patch changes the usage strings for the following subcommands: Differences of git-remote usages after applied your patch. diff -u before/git-remote-add-usage after/git-remote-add-usage --- before/git-remote-add-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-add-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote add [options] name url +usage: git remote add [-t branch] [-m master] [-f] [--tags|--no-tags] [--mirror=fetch|push] name url -f, --fetch fetch the remote branches --tagsimport all tags and associated objects when fetching diff -u before/git-remote-prune-usage after/git-remote-prune-usage --- before/git-remote-prune-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-prune-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote prune [options] name +usage: git remote prune [-n | --dry-run] name -n, --dry-run dry run diff -u before/git-remote-set-branches-usage after/git-remote-set-branches-usage --- before/git-remote-set-branches-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-set-branches-usage 2013-11-03 15:11:32.0 +0800 @@ -1,5 +1,4 @@ -usage: git remote set-branches name branch... - or: git remote set-branches --add name branch... +usage: git remote set-branches [--add] name branch... --add add branch diff -u before/git-remote-show-usage after/git-remote-show-usage --- before/git-remote-show-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-show-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote show [options] name +usage: git remote [-v | --verbose] show [-n] name -ndo not query remotes diff -u before/git-remote-update-usage after/git-remote-update-usage --- before/git-remote-update-usage 2013-11-03 15:10:06.0 +0800 +++ after/git-remote-update-usage 2013-11-03 15:11:32.0 +0800 @@ -1,4 +1,4 @@ -usage: git remote update [options] [group | remote]... +usage: git remote [-v | --verbose] update [-p | --prune] [(group | remote)...] -p, --prune prune remotes after fetching In order to get the differences of git-remote usages, I write a script. # SCRIPT to save git remote usage in files. for cmd in add set-head show prune update set-branches set-url; do git remote $cmd -h $DIR/git-remote-$cmd-usage done git remote -h $DIR/git-remote-usage git remote remove $DIR/git-remote-remove-usage 21 git remote rename $DIR/git-remote-rename-usage 21 Then I find two subcommands (remove and rename) are strange. * All other subcommands output usages to STDIN, but subcommands remove and rename send their usages to STDERR. * I can get the help message of all other subcommands using: git remote subcmd -h, but not git remote rm -h $ git remote rm -h error: Could not remove config section 'remote.-h' Later I know it's a side-effect that all other subcommands could print usages if provide a unkown -h/--help option. What if add a parse_options call for both rm and mv functions in builtin/remote.c? diff --git a/builtin/remote.c b/builtin/remote.c index 2f6366a..171d1a8 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -651,6 +651,8 @@ static int mv(int argc, const char **argv) struct rename_info rename; int i, refspec_updated = 0; + argc = parse_options(argc, argv, NULL, options, +builtin_remote_rename_usage, 0); if (argc != 3) usage_with_options(builtin_remote_rename_usage, options); @@ -808,6 +810,8 @@ static int rm(int argc, const char **argv) cb_data.skipped = skipped; cb_data.keep = known_remotes; + argc = parse_options(argc, argv, NULL, options, +builtin_remote_rm_usage,0); if (argc != 2) usage_with_options(builtin_remote_rm_usage, options); -- Jiang Xin -- 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 2/3] Windows: a test_cmp that is agnostic to random LF CRLF conversions
Am 02.11.2013 21:47, schrieb Sebastian Schuberth: So maybe it's a good point now to also change the MINGW prerequisite name to MSYS as part of your patch, and then name the functions more appropriately? It's too late. The series is already in master, and I see no point in a follow-up patch of this kind as long as there is no additional benefit. -- 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
git svn fetch stops at revision 1485500
I hope this is the right place to post this. When trying to fetch a very large svn using git svn it always terminates at commit 1485500. this is easily reproducible: git svn init -s https://svn.apache.org/repos/asf/onami/trunk git svn fetch -r 148:HEAD The commit 1485500 is not in the subtree of the svn I'm trying to fetch but in some unrelated place. So I think it is not the commit which causes the problem but an overflow of some kind. The command terminates without an error but after the command has terminated nothing shows up in my local git repo. There are no commits and no branches. I expected at least trunk to be available. Thank you for your help Stephan -- 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] Change sed i\ usage to something Solaris' sed can handle
Solaris' sed was choking on the i\ commands used in t4015-diff-whitespace as it couldn't parse the program properly. Modify two uses of sed that worked in GNU sed but not Solaris' (/usr/bin or /usr/xpg4/bin) to an equivalent form that is handled properly by both. Signed-off-by: Ben Walton bdwal...@gmail.com --- This addresses Andreas' comment about the extraneous \nl. Sorry, I misunderstood the original comment. t/t4015-diff-whitespace.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh index 3fb4b97..604a838 100755 --- a/t/t4015-diff-whitespace.sh +++ b/t/t4015-diff-whitespace.sh @@ -145,7 +145,7 @@ test_expect_success 'another test, with --ignore-space-at-eol' 'test_cmp expect test_expect_success 'ignore-blank-lines: only new lines' ' test_seq 5 x git update-index x - test_seq 5 | sed /3/i \\ + test_seq 5 | sed /3/i\\ x git diff --ignore-blank-lines out expect @@ -155,7 +155,8 @@ test_expect_success 'ignore-blank-lines: only new lines' ' test_expect_success 'ignore-blank-lines: only new lines with space' ' test_seq 5 x git update-index x - test_seq 5 | sed /3/i \ x + test_seq 5 | sed /3/i\\ + x git diff -w --ignore-blank-lines out expect test_cmp out expect -- 1.8.3.2 -- 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] push: Enhance unspecified push default warning
Is there anything I could do to improve this patch? Thank you. On Fri, Oct 4, 2013 at 10:20 AM, Greg Jacobson coder5...@gmail.com wrote: When the unset push.default warning message is displayed this may be the first time many users encounter push.default. Modified the warning message to explain in a compact manner what push.default is and why it is being changed in Git 2.0. Also provided additional information to help users decide if this change will affect their workflow. Signed-off-by: Greg Jacobson coder5...@gmail.com --- builtin/push.c | 9 + 1 file changed, 9 insertions(+) diff --git a/builtin/push.c b/builtin/push.c index 7b1b66c..5393e28 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -174,6 +174,15 @@ N_(push.default is unset; its implicit value is changing in\n \n git config --global push.default simple\n \n + When push.default is set to 'matching', git will push all local branches\n + to the remote branches with the same (matching) name. This will no\n + longer be the default in Git 2.0 because a branch could be\n + unintentionally pushed to a remote.\n + \n + In Git 2.0 the new push.default of 'simple' will push only the current\n + branch to the same remote branch used by git pull. A push will\n + only succeed if the remote and local branches have the same name.\n + \n See 'git help config' and search for 'push.default' for further information.\n (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\n 'current' instead of 'simple' if you sometimes use older versions of Git)); -- 1.8.4.474.g128a96c.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 2/8] git-sh-setup.sh: add variable to use the stuck-long mode
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 --- contrib/examples/git-checkout.sh | 1 + contrib/examples/git-clean.sh| 1 + contrib/examples/git-clone.sh| 1 + contrib/examples/git-merge.sh| 1 + contrib/examples/git-repack.sh | 1 + 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 ++ 12 files changed, 13 insertions(+) diff --git a/contrib/examples/git-checkout.sh b/contrib/examples/git-checkout.sh index 1a7689a48f07..d7507edaf564 100755 --- a/contrib/examples/git-checkout.sh +++ b/contrib/examples/git-checkout.sh @@ -1,6 +1,7 @@ #!/bin/sh OPTIONS_KEEPDASHDASH=t +OPTIONS_STUCKLONG= OPTIONS_SPEC=\ git-checkout [options] [branch] [paths...] -- diff --git a/contrib/examples/git-clean.sh b/contrib/examples/git-clean.sh index 01c95e9fe8a1..9d881cd90dfb 100755 --- a/contrib/examples/git-clean.sh +++ b/contrib/examples/git-clean.sh @@ -4,6 +4,7 @@ # OPTIONS_KEEPDASHDASH= +OPTIONS_STUCKLONG= OPTIONS_SPEC=\ git-clean [options] paths... diff --git a/contrib/examples/git-clone.sh b/contrib/examples/git-clone.sh index 547228e13ce6..ea4757db33ab 100755 --- a/contrib/examples/git-clone.sh +++ b/contrib/examples/git-clone.sh @@ -8,6 +8,7 @@ # See git-sh-setup why. unset CDPATH +OPTIONS_STUCKLONG= OPTIONS_SPEC=\ git-clone [options] [--] repo [dir] -- diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh index a5e42a9f0124..f0243d560121 100755 --- a/contrib/examples/git-merge.sh +++ b/contrib/examples/git-merge.sh @@ -4,6 +4,7 @@ # OPTIONS_KEEPDASHDASH= +OPTIONS_STUCKLONG= OPTIONS_SPEC=\ git merge [options] remote... git merge [options] msg HEAD remote diff --git a/contrib/examples/git-repack.sh b/contrib/examples/git-repack.sh index 757933174e4c..fd5ced527da5 100755 --- a/contrib/examples/git-repack.sh +++ b/contrib/examples/git-repack.sh @@ -4,6 +4,7 @@ # OPTIONS_KEEPDASHDASH= +OPTIONS_STUCKLONG= OPTIONS_SPEC=\ git repack [options] -- diff --git a/contrib/git-resurrect.sh b/contrib/git-resurrect.sh index a4ed4c3c62f0..d7e97bbc76c2 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 bbea43075be0..a3b6f988229c 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 e93a23867543..4aa3eb80fd25 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 8e17525dd86a..167d79fea809 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 226752fbff62..6ebef7e8b86e 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 fe21d5db631c..cf4f1505a54b 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 ebfe8f7a4d06..e1d66799693d 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -75,6 +75,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.8.4.2 -- 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 1/8] cherry-pick, revert: add the --gpg-sign option
Signed-off-by: Nicolas Vigier bo...@mars-attacks.org --- Documentation/git-cherry-pick.txt | 7 ++- Documentation/git-revert.txt | 6 +- builtin/revert.c | 2 ++ sequencer.c | 7 +++ sequencer.h | 2 ++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt index c205d2363e42..f1e6b2fd6d15 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 2de67a54962b..9eb83f01a451 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 87659c9fdb74..065d88dd05ea 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 06e52b4c83ff..b10a90fe70f6 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) { diff --git a/sequencer.h b/sequencer.h index 1fc22dcabe13..db43e9cf86dc 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.8.4.2 -- 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
Adding --gpg-sign to cherry-pick, revert, am, rebase
Hello, Here is a series of patches to add the --gpg-sign option to be able to gpg sign commits, to the cherry-pick, revert, am and rebase commands. Nicolas -- 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 5/8] rebase: remove useless arguments check
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 --- git-rebase.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/git-rebase.sh b/git-rebase.sh index 6ebef7e8b86e..6b9279a69028 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -236,12 +236,10 @@ do action=${1##--} ;; --onto) - test 2 -le $# || usage onto=$2 shift ;; -x) - test 2 -le $# || usage cmd=${cmd}exec $2${LF} shift ;; -- 1.8.4.2 -- 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 8/8] rebase: add the --gpg-sign option
Signed-off-by: Nicolas Vigier bo...@mars-attacks.org --- Documentation/git-rebase.txt | 4 git-rebase--am.sh| 8 +--- git-rebase--interactive.sh | 32 git-rebase--merge.sh | 2 +- git-rebase.sh| 11 +++ 5 files changed, 41 insertions(+), 16 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 94e07fdab550..ed25bc3e41d1 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 34e3102fcbfa..82ed63dd7874 100644 --- a/git-rebase--am.sh +++ b/git-rebase--am.sh @@ -5,7 +5,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 ;; @@ -25,7 +26,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 @@ -59,7 +60,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 3c6bed9a28f7..8aac6a85b192 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -184,7 +184,7 @@ exit_with_patch () { git rev-parse --verify HEAD $amend warn You can amend the commit now, with warn - warn git commit --amend + warn git commit --amend $gpg_sign_opt warn warn Once you are satisfied with your changes, run warn @@ -251,7 +251,8 @@ 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:+$gpg_sign_opt} \ + $strategy_args $empty_args $ff $@ } pick_one_preserving_merges () { @@ -362,7 +363,8 @@ 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:+$gpg_sign_opt} \ + $strategy_args $@ || die_with_patch $sha1 Could not pick $sha1 ;; esac @@ -473,7 +475,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 || @@ -500,7 +503,7 @@ do_next () { mark_action_done do_pick $sha1 $rest - git commit --amend --no-post-rewrite || { + git commit --amend --no-post-rewrite ${gpg_sign_opt:+$gpg_sign_opt} || { warn Could not amend commit after successfully picking $sha1... $rest warn This is most likely due to an empty commit message, or the pre-commit hook warn failed. If the pre-commit hook failed, you may need to resolve the issue before @@ -545,19 +548,22 @@ do_next () { squash|s|fixup|f) # This is an intermediate commit; its message will only be # used in case of trouble. So use the long version: - do_with_author output git commit --amend --no-verify -F $squash_msg || + do_with_author output git commit --amend --no-verify -F $squash_msg \ + ${gpg_sign_opt:+$gpg_sign_opt} || die_failed_squash $sha1 $rest ;; *)
[PATCH 3/8] am: parse options in stuck-long mode
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 --- git-am.sh | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/git-am.sh b/git-am.sh index a3b6f988229c..020abf6940bd 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.8.4.2 -- 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 7/8] rebase: parse options in stuck-long mode
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 --- git-rebase.sh | 50 ++ 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/git-rebase.sh b/git-rebase.sh index 2f2f8ded5c3f..a6c294b2289b 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] @@ -235,21 +235,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 ;; @@ -259,21 +257,19 @@ do --no-autosquash) autosquash= ;; - -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) @@ -282,21 +278,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 ;; @@ -309,14 +304,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.8.4.2 -- 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 4/8] am: add the --gpg-sign option
Signed-off-by: Nicolas Vigier bo...@mars-attacks.org --- 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 54d8461d61b2..17924d0f3ff3 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 020abf6940bd..dccbae2af0de 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 ${gpg_sign_opt:+$gpg_sign_opt} $tree ${parent:+-p} $parent \ + $dotest/final-commit ) git update-ref -m $GIT_REFLOG_ACTION: $FIRSTLINE HEAD $commit $parent || stop_here $this -- 1.8.4.2 -- 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
git status: minor output format error
git version 1.8.3.2 git status in German says (extract) # geändert: kajongg.py # gelöscht:playfield.py as you can see, there is one space too much before playfield.py LANG=C git status is correct: # modified: kajongg.py # deleted:playfield.py so it seems the spacing between the columns expects deleted to have the same number of letters in all languages. -- Wolfgang -- 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 1/8] cherry-pick, revert: add the --gpg-sign option
On Sun, Nov 03, 2013 at 04:54:17PM +0100, Nicolas Vigier wrote: diff --git a/sequencer.h b/sequencer.h index 1fc22dcabe13..db43e9cf86dc 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; One thing you're missing here is the ability to save and retrieve the options. You might be cherry-picking or reverting multiple commits and get interrupted (maybe one is already applied) and need to use --continue. So populate_options_cb and save_opts need to learn about this sequencer option so that after --continue, commits continue to get signed. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187 signature.asc Description: Digital signature
Re: [PATCH 1/8] cherry-pick, revert: add the --gpg-sign option
On Sun, 03 Nov 2013, brian m. carlson wrote: On Sun, Nov 03, 2013 at 04:54:17PM +0100, Nicolas Vigier wrote: diff --git a/sequencer.h b/sequencer.h index 1fc22dcabe13..db43e9cf86dc 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; One thing you're missing here is the ability to save and retrieve the options. You might be cherry-picking or reverting multiple commits and get interrupted (maybe one is already applied) and need to use --continue. So populate_options_cb and save_opts need to learn about this sequencer option so that after --continue, commits continue to get signed. Ah indeed, I didn't think about that. I will look at it. Thanks. pgpoGIMujtmkG.pgp Description: PGP signature
[PATCH] cherry-pick, revert: add the --gpg-sign option
Signed-off-by: Nicolas Vigier bo...@mars-attacks.org Helped-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 c205d2363e42..f1e6b2fd6d15 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 2de67a54962b..9eb83f01a451 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 87659c9fdb74..065d88dd05ea 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 06e52b4c83ff..2048cd81b3b2 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 1fc22dcabe13..db43e9cf86dc 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.8.4.2 -- 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] cherry-pick, revert: add the --gpg-sign option
On Sun, Nov 03, 2013 at 07:46:15PM +0100, Nicolas Vigier wrote: diff --git a/sequencer.c b/sequencer.c index 06e52b4c83ff..2048cd81b3b2 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++) Looks much better. That's essentially what I did when I was patching that particular area. Thanks for posting this patch set; it's something I've wanted for a while, but never got around to actually doing myself. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187 signature.asc Description: Digital signature
Re: What's cooking in git.git (Nov 2013, #01; Fri, 1)
On Fri, Nov 01, 2013 at 15:52:06 -0700, Junio C Hamano wrote: * th/reflog-annotated-tag (2013-10-28) 1 commit (merged to 'next' on 2013-11-01 at 8b154cc) + reflog: handle lightweight and annotated tags equally git log -g $annotated_tag, when there is no reflog history, should have produced a single output entry (i.e. the ref creation event), but instead showed the history leading to the tag. This isn't really what th/reflog-annotated-tag does, git log -g $annotated_tag now produces no output. Is the proper behavior to output the ref creation event? In that case, should the same happen for lightweight tags? Or am I missing something related to when there is no reflog history? Torstein -- 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] am: add the --gpg-sign option
Signed-off-by: Nicolas Vigier bo...@mars-attacks.org --- Second version of this patch. In the first version I forgot to save the status of the gpg-sign option so that it is also used with --continue. Documentation/git-am.txt | 6 +- git-am.sh| 11 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index 54d8461d61b2..17924d0f3ff3 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 020abf6940bd..dd2f4611f246 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 ;; *) @@ -564,6 +570,7 @@ Use \git am --abort\ to remove it.) echo $scissors $dotest/scissors echo $no_inbody_headers $dotest/no_inbody_headers echo $GIT_QUIET $dotest/quiet + echo $gpg_sign_opt $dotest/gpg-sign-opt echo 1 $dotest/next if test -n $rebasing then @@ -645,6 +652,7 @@ then else SIGNOFF= fi +gpg_sign_opt=$(cat $dotest/gpg-sign-opt) last=`cat $dotest/last` this=`cat $dotest/next` @@ -900,7 +908,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 ${gpg_sign_opt:+$gpg_sign_opt} $tree ${parent:+-p} $parent \ + $dotest/final-commit ) git update-ref -m $GIT_REFLOG_ACTION: $FIRSTLINE HEAD $commit $parent || stop_here $this -- 1.8.4.2 -- 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] builtin/remote: remove postfixcmp() and use suffixcmp() instead
Commit 8cc5b290 (git merge -Xoption, 25 Nov 2009) introduced suffixcmp() with nearly the same implementation as postfixcmp() that already existed since commit 211c8968 (Make git-remote a builtin, 29 Feb 2008). As postfixcmp() has always been static in builtin/remote.c and is used nowhere else, it makes more sense to remove it and use suffixcmp() instead in builtin/remote.c, rather than to remove suffixcmp(). Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- builtin/remote.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index 4e14891..9b3a98e 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -80,14 +80,6 @@ static int verbose; static int show_all(void); static int prune_remote(const char *remote, int dry_run); -static inline int postfixcmp(const char *string, const char *postfix) -{ - int len1 = strlen(string), len2 = strlen(postfix); - if (len1 len2) - return 1; - return strcmp(string + len1 - len2, postfix); -} - static int fetch_remote(const char *name) { const char *argv[] = { fetch, name, NULL, NULL }; @@ -277,13 +269,13 @@ static int config_read_branches(const char *key, const char *value, void *cb) enum { REMOTE, MERGE, REBASE } type; key += 7; - if (!postfixcmp(key, .remote)) { + if (!suffixcmp(key, .remote)) { name = xstrndup(key, strlen(key) - 7); type = REMOTE; - } else if (!postfixcmp(key, .merge)) { + } else if (!suffixcmp(key, .merge)) { name = xstrndup(key, strlen(key) - 6); type = MERGE; - } else if (!postfixcmp(key, .rebase)) { + } else if (!suffixcmp(key, .rebase)) { name = xstrndup(key, strlen(key) - 7); type = REBASE; } else -- 1.8.4.1.576.g36ba827.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
[RFC/PATCH] Add interpret-trailers builtin
This RFC patch shows the work in progress to implement a new command: git interpret-trailers 1) Rational: This command should help with RFC 822 style headers, called trailers, that are found at the end of commit messages. For a long time, these trailers have become a de facto standard way to add helpful information into commit messages. Until now git commit has only supported the well known Signed-off-by: trailer, that is used by many projects like the Linux kernel and Git. It is better to implement features for these trailers in a new command rather than in builtin/commit.c, because this way the prepare-commit-msg and commit-msg hooks can reuse this command. 2) Current state: Currently the usage string of this command is: git interpret-trailers [--trim-empty] [--infile=file] [token[=value]...] The following features are implemented: - the result is printed on stdout - the [token[=value]...] arguments are interpreted - a commit message passed using the --infile=file option is interpreted - the trailer.token.value options in the config are interpreted The following features are planned but not yet implemented: - some documentation - more tests - the trailer.token.if_exist config option - the trailer.token.if_missing config option - the trailer.token.command config option 3) Notes: * trailer seems better than commitTrailer as the config key because it looks like all the config keys are lower case and committrailer is not very readable. * trailer.token.value looks better than trailer.token.trailer, so I chose the former. * Rather than only one trailer.token.style config option, it seems better to me to have both trailer.token.if_exist and trailer.token.if_missing. * I might send a patch series instead of just one big patch when there will be fewer big changes in the code. Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- .gitignore| 1 + Makefile | 1 + builtin.h | 1 + builtin/interpret-trailers.c | 284 ++ git.c | 1 + strbuf.c | 7 ++ strbuf.h | 1 + t/t7513-interpret-trailers.sh | 101 +++ 8 files changed, 397 insertions(+) create mode 100644 builtin/interpret-trailers.c create mode 100755 t/t7513-interpret-trailers.sh diff --git a/.gitignore b/.gitignore index 66199ed..e6cf15b 100644 --- a/.gitignore +++ b/.gitignore @@ -73,6 +73,7 @@ /git-index-pack /git-init /git-init-db +/git-interpret-trailers /git-instaweb /git-log /git-lost-found diff --git a/Makefile b/Makefile index af847f8..96441f1 100644 --- a/Makefile +++ b/Makefile @@ -937,6 +937,7 @@ BUILTIN_OBJS += builtin/hash-object.o BUILTIN_OBJS += builtin/help.o BUILTIN_OBJS += builtin/index-pack.o BUILTIN_OBJS += builtin/init-db.o +BUILTIN_OBJS += builtin/interpret-trailers.o BUILTIN_OBJS += builtin/log.o BUILTIN_OBJS += builtin/ls-files.o BUILTIN_OBJS += builtin/ls-remote.o diff --git a/builtin.h b/builtin.h index b56cf07..88c2999 100644 --- a/builtin.h +++ b/builtin.h @@ -71,6 +71,7 @@ extern int cmd_hash_object(int argc, const char **argv, const char *prefix); extern int cmd_help(int argc, const char **argv, const char *prefix); extern int cmd_index_pack(int argc, const char **argv, const char *prefix); extern int cmd_init_db(int argc, const char **argv, const char *prefix); +extern int cmd_interpret_trailers(int argc, const char **argv, const char *prefix); extern int cmd_log(int argc, const char **argv, const char *prefix); extern int cmd_log_reflog(int argc, const char **argv, const char *prefix); extern int cmd_ls_files(int argc, const char **argv, const char *prefix); diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c new file mode 100644 index 000..2bcd480 --- /dev/null +++ b/builtin/interpret-trailers.c @@ -0,0 +1,284 @@ +/* + * Builtin git interpret-trailers + * + * Copyright (c) 2013 Christian Couder chrisc...@tuxfamily.org + * + */ + +#include cache.h +#include builtin.h +#include parse-options.h +#include strbuf.h + +static const char * const git_interpret_trailers_usage[] = { + N_(git interpret-trailers [--trim-empty] [--infile=file] [token[=value]...]), + NULL +}; + +static void parse_arg(struct strbuf *tok, struct strbuf *val, const char *arg) +{ + char *end = strchr(arg, '='); + if (!end) + end = strchr(arg, ':'); + if (end) { + strbuf_add(tok, arg, end - arg); + strbuf_trim(tok); + strbuf_addstr(val, end + 1); + strbuf_trim(val); + } else { + strbuf_addstr(tok, arg); + strbuf_trim(tok); + } +} + +static struct string_list trailer_list; + +enum style_if_exist { DONT_REPEAT, OVERWRITE, REPEAT }; +enum style_if_missing { DONT_APPEND, APPEND }; +
[ANN] git-arr 0.12
Hi! git-arr is a git repository browser that can generate static HTML instead of having to run dynamically. I've just released version 0.12, which includes minor bug fixes and the following new features: - Support for embedded markdown and image files in the blob view (thanks to Vanya Sergeev). - Show the age of a repository in the index. You can find it at http://blitiri.com.ar/p/git-arr. Thanks! Alberto -- 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: [RFC/PATCH] Add interpret-trailers builtin
On Sun, Nov 3, 2013 at 10:17 PM, Christian Couder chrisc...@tuxfamily.org wrote: This RFC patch shows the work in progress to implement a new command: First of all: Thanks for working on this! This looks like a really good start. Plenty of comments below (mostly either to learn myself, or to check what alternatives you've considered), but overall, I'm happy about where this is going. git interpret-trailers Pesonally, I'd rather name it git process-footers, since I think process better captures the two-way functionality of this program (both parsing/interpreting _and_ generating/writiing), and I believe I'm not alone in preferring footer over trailer. That said, this is certainly bikeshedding territory, and I am not the one writing the code, so feel free to ignore. 1) Rational: s/Rational/Rationale/ This command should help with RFC 822 style headers, called trailers, that are found at the end of commit messages. As has been asked earlier in this discussion, we should probably specify explicitly what we _mean_ with RFC822-style headers/footers/trailers, and exactly how closely we follow the actual RFC... E.g. do we make use of the linebreaking rules? encoding handling? etc... We may want to take a more relaxed approach (after all, we're not including a complete RFC822/RFC2822 implementation), but we should at least state so, and possibly how/why we do so. For a long time, these trailers have become a de facto standard way to add helpful information into commit messages. Until now git commit has only supported the well known Signed-off-by: trailer, that is used by many projects like the Linux kernel and Git. It is better to implement features for these trailers in a new command rather than in builtin/commit.c, because this way the prepare-commit-msg and commit-msg hooks can reuse this command. 2) Current state: Currently the usage string of this command is: git interpret-trailers [--trim-empty] [--infile=file] [token[=value]...] --trim-empty will remove empty footers given on the command-line? Or in the infile? or both? I think I'm fine with both, but I wonder if there is a use case for treating the two types of empty footers separately... The following features are implemented: - the result is printed on stdout - the [token[=value]...] arguments are interpreted - a commit message passed using the --infile=file option is interpreted If the output is written to stdout, then why is not the input taken from stdin? Or vice versa: why not --outfile? - the trailer.token.value options in the config are interpreted This is the default value of the footer if not further specified on the command-line? The following features are planned but not yet implemented: - some documentation - more tests - the trailer.token.if_exist config option - the trailer.token.if_missing config option Not sure what these two options will do, or what kind of values they take... - the trailer.token.command config option I guess the value of .command is executed to generate the default content of the footer? 3) Notes: * trailer seems better than commitTrailer as the config key because it looks like all the config keys are lower case and committrailer is not very readable. As stated above, I prefer footer over trailer... * trailer.token.value looks better than trailer.token.trailer, so I chose the former. * Rather than only one trailer.token.style config option, it seems better to me to have both trailer.token.if_exist and trailer.token.if_missing. * I might send a patch series instead of just one big patch when there will be fewer big changes in the code. Maybe at least split in two: - One patch to deal with the administrivia of adding a new command. - One (or more) patch(es) to introduce the logic/functionality of the new command. Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- .gitignore| 1 + Makefile | 1 + builtin.h | 1 + builtin/interpret-trailers.c | 284 ++ git.c | 1 + strbuf.c | 7 ++ strbuf.h | 1 + t/t7513-interpret-trailers.sh | 101 +++ 8 files changed, 397 insertions(+) create mode 100644 builtin/interpret-trailers.c create mode 100755 t/t7513-interpret-trailers.sh diff --git a/.gitignore b/.gitignore index 66199ed..e6cf15b 100644 --- a/.gitignore +++ b/.gitignore @@ -73,6 +73,7 @@ /git-index-pack /git-init /git-init-db +/git-interpret-trailers /git-instaweb /git-log /git-lost-found diff --git a/Makefile b/Makefile index af847f8..96441f1 100644 --- a/Makefile +++ b/Makefile @@ -937,6 +937,7 @@ BUILTIN_OBJS += builtin/hash-object.o BUILTIN_OBJS += builtin/help.o BUILTIN_OBJS += builtin/index-pack.o BUILTIN_OBJS +=
Re: git status: minor output format error
On Mon, Nov 4, 2013 at 12:17 AM, Wolfgang Rohdewald wolfg...@rohdewald.de wrote: git version 1.8.3.2 git status in German says (extract) # geändert: kajongg.py # gelöscht:playfield.py as you can see, there is one space too much before playfield.py LANG=C git status is correct: # modified: kajongg.py # deleted:playfield.py so it seems the spacing between the columns expects deleted to have the same number of letters in all languages. No, the translations control the number of columns in this case (although it's not very intuitive for translators). Something like this may fix it. I haven't tested because I don't have de locale installed. diff --git a/po/de.po b/po/de.po index 35a44b9..d1846d2 100644 --- a/po/de.po +++ b/po/de.po @@ -1404,7 +1404,7 @@ msgstr kopiert: %s - %s #: wt-status.c:313 #, c-format msgid deleted:%s -msgstr gelöscht:%s +msgstr gelöscht: %s #: wt-status.c:316 #, c-format -- 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
[PATCH] wt-status: take the alignment burden off translators
It's not easy for translators to see spaces in these strings have to align, especially when there are no guarantees that these strings are grouped together in .po files. Refactor the code and do the alignment automatically. Let the translator specify how big the alignment is, though, in case some languages need more than 12 columns for the preceding text. Noticed-by: Wolfgang Rohdewald wolfg...@rohdewald.de Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Ralf and Quan, don't update your translations yet. If this change gets merged it'll simplify your task a bit. wt-status.c | 51 +++ 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/wt-status.c b/wt-status.c index b4e44ba..f9715d3 100644 --- a/wt-status.c +++ b/wt-status.c @@ -15,6 +15,7 @@ #include submodule.h #include column.h #include strbuf.h +#include utf8.h static char default_wt_status_colors[][COLOR_MAXLEN] = { GIT_COLOR_NORMAL, /* WT_STATUS_HEADER */ @@ -276,6 +277,10 @@ static void wt_status_print_change_data(struct wt_status *s, const char *one, *two; struct strbuf onebuf = STRBUF_INIT, twobuf = STRBUF_INIT; struct strbuf extra = STRBUF_INIT; + const char *what; + static const char *spaces = ; + static int width = -1; + int len; one_name = two_name = it-string; switch (change_type) { @@ -309,32 +314,62 @@ static void wt_status_print_change_data(struct wt_status *s, status_printf(s, color(WT_STATUS_HEADER, s), \t); switch (status) { case DIFF_STATUS_ADDED: - status_printf_more(s, c, _(new file: %s), one); + what = _(new file); break; case DIFF_STATUS_COPIED: - status_printf_more(s, c, _(copied: %s - %s), one, two); + what = _(copied); break; case DIFF_STATUS_DELETED: - status_printf_more(s, c, _(deleted:%s), one); + what = _(deleted); break; case DIFF_STATUS_MODIFIED: - status_printf_more(s, c, _(modified: %s), one); + what = _(modified); break; case DIFF_STATUS_RENAMED: - status_printf_more(s, c, _(renamed:%s - %s), one, two); + what = _(renamed); break; case DIFF_STATUS_TYPE_CHANGED: - status_printf_more(s, c, _(typechange: %s), one); + what = _(typechange); break; case DIFF_STATUS_UNKNOWN: - status_printf_more(s, c, _(unknown:%s), one); + what = _(unknown); break; case DIFF_STATUS_UNMERGED: - status_printf_more(s, c, _(unmerged: %s), one); + what = _(unmerged); break; default: die(_(bug: unhandled diff status %c), status); } + if (width == -1) { + /* +* Translators: if you do translate this, replace it +* with a decimal number of how many columns needed +* to align file names in git status: +* +* |-columns-| +* +* unmerged: foo.c +* copied: foo.c - bar.c +* +* The default value is 12. Normally you would not +* need to translate this at all unless the translated +* strings are longer than 12 columns and therefore +* break alignment. +*/ + width = atoi(_(wt-status.c:width)); + if (width = 0 || width 32) + width = 12; + } + if (width utf8_strwidth(what) + 1) + len = width - utf8_strwidth(what) - 1; + else + len = 0; + if (status == DIFF_STATUS_COPIED || status == DIFF_STATUS_RENAMED) + status_printf_more(s, c, %s:%.*s%s - %s, + what, len, spaces, one, two); + else + status_printf_more(s, c, %s:%.*s%s, + what, len, spaces, one); if (extra.len) { status_printf_more(s, color(WT_STATUS_HEADER, s), %s, extra.buf); strbuf_release(extra); -- 1.8.2.83.gc99314b -- 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
New order sample
Please open the link: (http://rghost.net/49896901) which is in exe format to view order samples that we want to place with your company. Give me price list for these samples. Regards, Shirley Shmight A. Sales manager -- 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
Importing from subversion with full history
I'm trying to import our team's old subversion repository to git, but I'd like to retain the commit history. I tried 'git svn clone' but that only retrieves commits from the last copy onwards. Because the svn setup is really bad, there is no way I can reproduce the stdlayout structure that 'git svn' likes, or any other structure where the trunk isn't a just few versions down from a copy. Is there a way to have 'git svn' not do --stop-on-copy when fetching history? I'm perfectly fine with getting a simple linear history (because trying to do anything else with our svn setup will put our sanity in danger), but I couldn't find any documentation on how to do so. Thanks in advance, -- Oded -- 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: git status: minor output format error
On Mon, Nov 4, 2013 at 2:46 AM, Duy Nguyen pclo...@gmail.com wrote: On Mon, Nov 4, 2013 at 12:17 AM, Wolfgang Rohdewald wolfg...@rohdewald.de wrote: git version 1.8.3.2 git status in German says (extract) # geändert: kajongg.py # gelöscht:playfield.py as you can see, there is one space too much before playfield.py LANG=C git status is correct: # modified: kajongg.py # deleted:playfield.py so it seems the spacing between the columns expects deleted to have the same number of letters in all languages. No, the translations control the number of columns in this case (although it's not very intuitive for translators). Something like this may fix it. I haven't tested because I don't have de locale installed. diff --git a/po/de.po b/po/de.po index 35a44b9..d1846d2 100644 --- a/po/de.po +++ b/po/de.po @@ -1404,7 +1404,7 @@ msgstr kopiert: %s - %s #: wt-status.c:313 #, c-format msgid deleted:%s -msgstr gelöscht:%s +msgstr gelöscht: %s The columns don't match in other related messages, either. Let's see what happens with [1]. [1] http://article.gmane.org/gmane.comp.version-control.git/237283 #: wt-status.c:316 #, c-format -- 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