RE: [PATCH 1/7] remote-hg: don't decode UTF-8 paths into Unicode objects
Richard Hansen wrote: The internal mercurial API expects ordinary 8-bit string objects, not Unicode string objects. With this change, the test-hg.sh unit tests pass again. This makes sense to me, but the tests are already passing for me. How are they failing for you? -- Felipe Contreras -- 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/7] test-bzr.sh, test-hg.sh: allow running from any dir
Richard Hansen wrote: cd to the t/ subdirectory so that the user doesn't already have to be in the test directory to run these test scripts. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-bzr.sh | 1 + contrib/remote-helpers/test-hg.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 5c50251..094062c 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -5,6 +5,7 @@ test_description='Test remote-bzr' +cd ${0%/*}/../../t || exit 1 I think this should do the trick: test -z $TEST_DIRECTORY TEST_DIRECTORY=$(realpath ${0%/*}/../../t) . $TEST_DIRECTORY/test-lib.sh -- Felipe Contreras -- 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 3/7] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
Richard Hansen wrote: Change 'git push' to 'git push -u remote branch' in one of the test-bzr.sh tests to ensure that the test continues to pass when the default value of push.default changes to simple. This makes sense. Also, explicitly set push.default to simple to silence warnings when using --verbose. This doesn't. Run the tests in t/* and you would seen tons and tons of those warnings, if they should be avoided, they should be avoided for all the tests, why only these? I say drop the second part. Yes it's annoying, but we have to deal with it. -- Felipe Contreras -- 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 4/7] test-hg.sh: eliminate 'local' bashism
Richard Hansen wrote: Unlike bash, POSIX shell does not specify a 'local' command for declaring function-local variable scope. Except for IFS, the variable names are not used anywhere else in the script so simply remove the 'local'. For IFS, move the assignment to the 'read' command to prevent it from affecting code outside the function. Makes sense. -- Felipe Contreras -- 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 6/7] test-hg.sh: help user correlate verbose output with email test
Richard Hansen wrote: It's hard to tell which author conversion test failed when the email addresses look similar. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 84c67ff..5eda265 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -209,16 +209,16 @@ test_expect_success 'authors' ' ../expected author_test alpha H G Wells we...@example.com - author_test beta test test unknown - author_test beta test t...@example.com (comment) test t...@example.com - author_test gamma t...@example.com Unknown t...@example.com - author_test delta namet...@example.com name t...@example.com - author_test epsilon name t...@example.com name t...@example.com - author_test zeta test test unknown - author_test eta test t...@example.com test t...@example.com - author_test theta test t...@example.com test t...@example.com - author_test iota test test at example dot com test unknown - author_test kappa t...@example.com Unknown t...@example.com + author_test beta beta beta unknown + author_test beta beta t...@example.com (comment) beta t...@example.com Two betas? + author_test gamma ga...@example.com Unknown ga...@example.com + author_test delta deltat...@example.com delta t...@example.com + author_test epsilon epsilon t...@example.com epsilon t...@example.com + author_test zeta zeta zeta unknown + author_test eta eta t...@example.com eta t...@example.com + author_test theta theta t...@example.com theta t...@example.com + author_test iota iota test at example dot com iota unknown + author_test kappa ka...@example.com Unknown ka...@example.com ) git clone hg::hgrepo gitrepo -- Felipe Contreras -- 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 7/7] remote-bzr, remote-hg: fix email address regular expression
Richard Hansen wrote: Before, strings like foo@example.com would be converted to foo. b...@example.com when they should be unknown foo@example.com. Indeed. Thanks. -- Felipe Contreras -- 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 5/7] test-hg.sh: avoid obsolete 'test' syntax
Richard Hansen wrote: The POSIX spec says that the '-a', '-o', and parentheses operands to the 'test' utility are obsolete extensions due to the potential for ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. All right, if you say so. -- Felipe Contreras -- 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 12/10] remote-bzr: support the new 'force' option
Richard Hansen wrote: Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/git-remote-bzr | 34 +- contrib/remote-helpers/test-bzr.sh| 22 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 7e34532..ba693d1 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -42,6 +42,7 @@ import json import re import StringIO import atexit, shutil, hashlib, urlparse, subprocess +import types NAME_RE = re.compile('^([^]+)') AUTHOR_RE = re.compile('^([^]+?)? ?[]([^]*)(?:$|)') @@ -684,7 +685,8 @@ def do_export(parser): peer = bzrlib.branch.Branch.open(peers[name], possible_transports=transports) try: -peer.bzrdir.push_branch(branch, revision_id=revid) +peer.bzrdir.push_branch(branch, revision_id=revid, +overwrite=force) except bzrlib.errors.DivergedBranches: print error %s non-fast forward % ref continue @@ -718,8 +720,34 @@ def do_capabilities(parser): print *import-marks %s % path print *export-marks %s % path +print option print +class InvalidOptionValue(Exception): +pass + +def do_option(parser): +(opt, val) = parser[1:3] +handler = globals().get('do_option_' + opt) +if handler and type(handler) == types.FunctionType: +try: +handler(val) +except InvalidOptionValue: +print error '%s' is not a valid value for option '%s' % (val, opt) +else: +print unsupported + +def do_bool_option(val): +if val == 'true': ret = True +elif val == 'false': ret = False +else: raise InvalidOptionValue() +print ok +return ret + +def do_option_force(val): +global force +force = do_bool_option(val) + While this organization has merit, I think it's overkill for a single option, or just a couple of them. If in the future we add more, we might revisit this, for the moment something like this would suffice: class InvalidOptionValue(Exception): pass def get_bool_option(val): if val == 'true': return True elif val == 'false': return False else: raise InvalidOptionValue() def do_option(parser): global force _, key, value = parser.line.split(' ') try: if key == 'force': force = get_bool_option(value) print 'ok' else: print 'unsupported' except InvalidOptionValue: print error '%s' is not a valid value for option '%s' % (value, key) Cheers. -- Felipe Contreras -- 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 00/86] replace prefixcmp() with has_prefix()
On 2013-11-09 08:05, Christian Couder wrote: Here is a big patch series to replace prefixcmp() with a new has_prefix() function. Seems like totally useless codechurn to me. Besides, prefixcmp() ties in nicely with strcmp() and memcmp() (and returns 0 on a match just like its namesakes), whereas your function must return non-zero on match and thus can't be used as a qsort() callback. Granted, prefixcmp() lends itself poorly to that as well, but at least it's consistent with the other *cmp() functions. So -1 on this whole series. -- Andreas Ericsson andreas.erics...@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace. -- 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
Marc Branchaud marcn...@xiplink.com writes: - 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 + In Git 2.0, Git will default to the more conservative 'simple'\n + behavior that only pushes the current branch to the corresponding\n + remote branch used by 'git pull' to update the current branch from.\n That reads a bit awkwardly. How about: In Git 2.0, Git will default to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch. OK, here is the version of Greg's patch (i.e. for versions before 2.0) with the above. The endgame patch for 2.0 would change the line that begins with In Git 2.0, to: Since Git 2.0, Git defaults to the more conservative ... Is everybody happy with this version? -- 8 -- From: Greg Jacobson coder5...@gmail.com Date: Fri, 4 Oct 2013 10:20:07 -0400 Subject: [PATCH] push: Enhance unspecified push default warning When the unset push.default warning message is displayed this may be the first time many users encounter push.default. Explain in the warning message in a compact manner what push.default is and what the change means to the end-user to help the users decide. Signed-off-by: Greg Jacobson coder5...@gmail.com Helped-by: Jonathan Nieder jrnie...@gmail.com Helped-by: Matthieu Moy matthieu@imag.fr Helped-by: Marc Branchaud marcn...@xiplink.com Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/push.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/push.c b/builtin/push.c index 7b1b66c..a73982a 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -174,6 +174,13 @@ 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 local branches\n + to the remote branches that already exist with the same name.\n + \n + In Git 2.0, Git will default to the more conservative 'simple'\n + behavior, which only pushes the current branch to the corresponding\n + remote branch that 'git pull' uses to update the current branch.\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.5-rc1-310-g1febc12 -- 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
Junio C Hamano wrote: Is everybody happy with this version? Looks good to me. Thanks, Jonathan -- 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
On 13-11-11 12:02 PM, Junio C Hamano wrote: Is everybody happy with this version? Looks good. M. -- 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] git-fetch-pack uses URLs like git-fetch
Torsten Bögershausen tbo...@web.de writes: git fetch-pack allows [host:]directory to point out the source repository. Use the term repository, which is already used in git fetch or git pull to describe URLs supported by Git. Sign-off? --- Documentation/git-fetch-pack.txt | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt index 444b805..93b5067 100644 --- a/Documentation/git-fetch-pack.txt +++ b/Documentation/git-fetch-pack.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--include-tag] [--upload-pack=git-upload-pack] [--depth=n] [--no-progress] - [-v] [host:]directory [refs...] + [-v] repository [refs...] DESCRIPTION --- @@ -97,19 +97,18 @@ be in a separate packet, and the list must end with a flush packet. -v:: Run verbosely. -host:: - A remote host that houses the repository. When this - part is specified, 'git-upload-pack' is invoked via - ssh. - -directory:: - The repository to sync from. +repository:: + The URL to the remote repository. refs...:: The remote heads to update from. This is relative to $GIT_DIR (e.g. HEAD, refs/heads/master). When unspecified, update from all heads the remote side has. +SEE ALSO + +linkgit:git-fetch[1] + GIT --- Part of the linkgit:git[1] suite -- 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/4] Minor grammatical fixes in git log man page
Jonathan Nieder jrnie...@gmail.com writes: Jason St. John wrote: git-log.txt: grammatical fixes under --log-size option Thanks. [...] --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@ -56,10 +56,10 @@ Note that this affects all diff-based output types, e.g. those produced by --stat etc. --log-size:: -Before the log message print out its size in bytes. Intended +Before the log message, print out its size in bytes. Intended Either reads well at least for me. mainly for porcelain tools consumption. If Git is unable to -produce a valid value size is set to zero. -Note that only message is considered, if also a diff is shown +produce a valid value size, this is set to zero. +Note that only message is considered. Also, if a diff is shown, its size is not included. I have no idea what this option does, before or after the change. The original is probably more accurate, if harder to read. The byte-size of the message part of log output is reported, so that tools like QGit can slurp that many bytes and then treat the remainder as a patch (if -p, --stat, etc. were given). Perhaps some of the above could make it into a clearer description? E.g., --log-size:: Include a line log size number in the output for each commit, where number is the length of that commit's message in bytes. Intended to speed up tools that read log messages from 'git log' output by allowing them to allocate space in advance. Yeah, that reads better. We do not have to single out if also a diff is shown, as there are other kinds of output that can follow the message proper, and they are not counted. The commit introducing --log-size also says: In case it is not possible to know the size upfront size value is set to zero. Is this still true? When is it not possible to know the size up front? I have no idea ;-) Perhaps Marco can enlighten us? The implementation of --log-size is if (opt-show_log_size) { printf(log size %i\n, (int)msgbuf.len); graph_show_oneline(opt-graph); } What happens if the commit message is long enough to overflow a 32-bit integer? Is that impossible for other reasons? If it is possible, (not about this patch) should this be using a 64-bit integer to print instead? A nice low-hanging fruit ;-) Thanks -- 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/4] Emphasize options and force ASCIIDOC escaping of --
Jason St. John jstj...@purdue.edu writes: rev-list-options.txt: replace e.g. `--foo` with '\--foo' rev-list-options.txt: emphasize, instead of quote, some option arguments (e.g. foo-option becomes 'foo-option') rev-list-options.txt: force ASCIIDOC escaping of -- (e.g. '--bar' becomes '\--bar') rev-list-options.txt: add single quote chars around options missing them (e.g. --grep becomes '\--grep') rev-list-options.txt: replaced one instance of regexp with regular expressions rev-list-options.txt: fix typo in --no-walk description (show -- shown) rev-list-options.txt: replaced some instances of double quotes with their ASCIIDOC equivalent (e.g. a - character becomes a ``-'' character, Gaah. Did you really have to repeat rev-list-options.txt: on all the lines? Sorry for the messy quoting in the last set of examples in the commit message. I have a feeling that many of them can and should be turned from '--opt' to `--opt`. For example, this original: Mark which side of a symmetric diff a commit is reachable from. Commits from the left side are prefixed with `` and those from - the right with ``. If combined with `--boundary`, those - commits are prefixed with `-`. + the right with ``. If combined with '\--boundary', those + commits are prefixed with ``-''. seems to render correctly at https://git-htmldocs.googlecode.com/git/git-rev-list.html without this part of the patch. -- 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 12/10] remote-bzr: support the new 'force' option
On 2013-11-11 06:51, Felipe Contreras wrote: Richard Hansen wrote: Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/git-remote-bzr | 34 +- contrib/remote-helpers/test-bzr.sh| 22 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 7e34532..ba693d1 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -42,6 +42,7 @@ import json import re import StringIO import atexit, shutil, hashlib, urlparse, subprocess +import types NAME_RE = re.compile('^([^]+)') AUTHOR_RE = re.compile('^([^]+?)? ?[]([^]*)(?:$|)') @@ -684,7 +685,8 @@ def do_export(parser): peer = bzrlib.branch.Branch.open(peers[name], possible_transports=transports) try: -peer.bzrdir.push_branch(branch, revision_id=revid) +peer.bzrdir.push_branch(branch, revision_id=revid, +overwrite=force) except bzrlib.errors.DivergedBranches: print error %s non-fast forward % ref continue @@ -718,8 +720,34 @@ def do_capabilities(parser): print *import-marks %s % path print *export-marks %s % path +print option print +class InvalidOptionValue(Exception): +pass + +def do_option(parser): +(opt, val) = parser[1:3] +handler = globals().get('do_option_' + opt) +if handler and type(handler) == types.FunctionType: +try: +handler(val) +except InvalidOptionValue: +print error '%s' is not a valid value for option '%s' % (val, opt) +else: +print unsupported + +def do_bool_option(val): +if val == 'true': ret = True +elif val == 'false': ret = False +else: raise InvalidOptionValue() +print ok +return ret + +def do_option_force(val): +global force +force = do_bool_option(val) + While this organization has merit, I think it's overkill for a single option, or just a couple of them. If in the future we add more, we might revisit this, for the moment something like this would suffice: OK, I'll reroll. class InvalidOptionValue(Exception): pass def get_bool_option(val): if val == 'true': return True elif val == 'false': return False else: raise InvalidOptionValue() def do_option(parser): global force _, key, value = parser.line.split(' ') I'm surprised you prefer this over 'key, val = parser[1:3]' or even '_, key, val = parser[:]'. Are you intending to eventually remove Parser.__getitem__()? Thanks, Richard try: if key == 'force': force = get_bool_option(value) print 'ok' else: print 'unsupported' except InvalidOptionValue: print error '%s' is not a valid value for option '%s' % (value, key) Cheers. -- 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 12/10] remote-bzr: support the new 'force' option
On Mon, Nov 11, 2013 at 12:12 PM, Richard Hansen rhan...@bbn.com wrote: On 2013-11-11 06:51, Felipe Contreras wrote: def do_option(parser): global force _, key, value = parser.line.split(' ') I'm surprised you prefer this over 'key, val = parser[1:3]' or even '_, key, val = parser[:]'. Are you intending to eventually remove Parser.__getitem__()? I don't, actually. I'm fine with either way. Cheers. -- Felipe Contreras -- 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 0/4] Remove deprecated commands
John Keeping j...@keeping.me.uk writes: git repo-config, git tar-tree, git lost-found and git peek-remote have all been deprecated since at least Git 1.5.4. With Git 2.0 approaching, I think that would be a good point to remove then completely, which is what this series does. Probably good material to discuss during the next cycle. As a totally unscientific sanity check, I asked Google to show these since Nov 13, 2011: [git repo-config] vs [git config]: 136 vs 232 [git peek-remote] vs [git ls-remote]: 62 vs 133 [git tar-tree] vs [git archive]: 73 vs 189 [git lost-found] vs [git fsck --lost-found]: 96 vs 83 So I think 1, 2, and 4 are OK to ship in whatever version that comes after the upcoming 1.8.5, but we might have to hold onto lost-found a bit longer. The command does show a deprecation warning, so there is nothing to change at this point. Thanks. -- 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 12/10] git-remote-testgit: support the new 'force' option
Richard Hansen rhan...@bbn.com writes: I think the convention is to align these: case $opt in force) The existing case statement in this file indents the patterns the same amount as the case statement, so this should be aligned to match. In general I rarely see the case patterns indented at the same level as the case statement, What you see does not matter in the context of this project ;-) This is what we have in Documentation/CodingGuidelines: For shell scripts specifically (not exhaustive): - Case arms are indented at the same depth as case and esac lines. Thanks. -- 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/7] remote-hg: don't decode UTF-8 paths into Unicode objects
On 2013-11-11 06:04, Felipe Contreras wrote: Richard Hansen wrote: The internal mercurial API expects ordinary 8-bit string objects, not Unicode string objects. With this change, the test-hg.sh unit tests pass again. This makes sense to me, but the tests are already passing for me. How are they failing for you? $ hg --version | head -n 1 Mercurial Distributed SCM (version 2.2.2) $ cd ~/git/t $ ../contrib/remote-helpers/test-hg.sh --verbose --immediate ... Traceback (most recent call last): File ~/git/contrib/remote-helpers/git-remote-hg, line 1246, in module sys.exit(main(sys.argv)) File ~/git/contrib/remote-helpers/git-remote-hg, line 1230, in main do_export(parser) File ~/git/contrib/remote-helpers/git-remote-hg, line 1031, in do_export parse_commit(parser) File ~/git/contrib/remote-helpers/git-remote-hg, line 822, in parse_commit node = hghex(repo.commitctx(ctx)) File /usr/lib/python2.7/dist-packages/mercurial/localrepo.py, line 1270, in commitctx p2.manifestnode(), (new, drop)) File /usr/lib/python2.7/dist-packages/mercurial/manifest.py, line 197, in add cachedelta = (self.rev(p1), addlistdelta(addlist, delta)) File /usr/lib/python2.7/dist-packages/mercurial/manifest.py, line 124, in addlistdelta addlist[start:end] = array.array('c', content) TypeError: array item must be char not ok 4 - update bookmark I can put the above in the commit message if people would like it there. -Richard -- 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/7] test-bzr.sh, test-hg.sh: allow running from any dir
Felipe Contreras felipe.contre...@gmail.com writes: Richard Hansen wrote: cd to the t/ subdirectory so that the user doesn't already have to be in the test directory to run these test scripts. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-bzr.sh | 1 + contrib/remote-helpers/test-hg.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 5c50251..094062c 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -5,6 +5,7 @@ test_description='Test remote-bzr' +cd ${0%/*}/../../t || exit 1 I think this should do the trick: test -z $TEST_DIRECTORY TEST_DIRECTORY=$(realpath ${0%/*}/../../t) . $TEST_DIRECTORY/test-lib.sh Can we do that without using realpath(1)? I do not think we use it anywhere in the main part of the project. -- 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/7] remote-hg, remote-bzr fixes
Richard Hansen rhan...@bbn.com writes: A handful of fixes for the git-remote-hg and git-remote-bzr remote helpers and their unit tests. Richard Hansen (7): remote-hg: don't decode UTF-8 paths into Unicode objects test-bzr.sh, test-hg.sh: allow running from any dir test-bzr.sh, test-hg.sh: prepare for change to push.default=simple test-hg.sh: eliminate 'local' bashism test-hg.sh: avoid obsolete 'test' syntax test-hg.sh: help user correlate verbose output with email test remote-bzr, remote-hg: fix email address regular expression contrib/remote-helpers/git-remote-bzr | 7 +++ contrib/remote-helpers/git-remote-hg | 9 - contrib/remote-helpers/test-bzr.sh| 6 +- contrib/remote-helpers/test-hg.sh | 31 ++- 4 files changed, 30 insertions(+), 23 deletions(-) I'll defer to Felipe for the meat of the logic in these scripts; the POSIXify part of the fixes look all good to me. I see there already are review comments, so let me know when the reviews have settled with a final reroll. Thanks. -- 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 0/4] Remove deprecated commands
On Mon, Nov 11, 2013 at 10:25:51AM -0800, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: git repo-config, git tar-tree, git lost-found and git peek-remote have all been deprecated since at least Git 1.5.4. With Git 2.0 approaching, I think that would be a good point to remove then completely, which is what this series does. Probably good material to discuss during the next cycle. As a totally unscientific sanity check, I asked Google to show these since Nov 13, 2011: [git repo-config] vs [git config]: 136 vs 232 [git peek-remote] vs [git ls-remote]: 62 vs 133 [git tar-tree] vs [git archive]: 73 vs 189 [git lost-found] vs [git fsck --lost-found]: 96 vs 83 So I think 1, 2, and 4 are OK to ship in whatever version that comes after the upcoming 1.8.5, but we might have to hold onto lost-found a bit longer. The command does show a deprecation warning, so there is nothing to change at this point. I was assuming these would be queued as a held until 2.0 branch, but if you think some can go earlier I can re-send this once 1.8.5 is out of the way. -- 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/7] test-bzr.sh, test-hg.sh: allow running from any dir
On Mon, Nov 11, 2013 at 12:31 PM, Junio C Hamano gits...@pobox.com wrote: Felipe Contreras felipe.contre...@gmail.com writes: Richard Hansen wrote: cd to the t/ subdirectory so that the user doesn't already have to be in the test directory to run these test scripts. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-bzr.sh | 1 + contrib/remote-helpers/test-hg.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 5c50251..094062c 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -5,6 +5,7 @@ test_description='Test remote-bzr' +cd ${0%/*}/../../t || exit 1 I think this should do the trick: test -z $TEST_DIRECTORY TEST_DIRECTORY=$(realpath ${0%/*}/../../t) . $TEST_DIRECTORY/test-lib.sh Can we do that without using realpath(1)? I do not think we use it anywhere in the main part of the project. Something like this, probably: --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -26,6 +26,8 @@ then # outside of t/, e.g. for running tests on the test library # itself. TEST_DIRECTORY=$(pwd) +else + TEST_DIRECTORY=$(cd $TEST_DIRECTORY pwd) fi if test -z $TEST_OUTPUT_DIRECTORY then Then we can do: test -z $TEST_DIRECTORY TEST_DIRECTORY=${0%/*}/../../t . $TEST_DIRECTORY/test-lib.sh -- Felipe Contreras -- 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 rm / format-patch / am fails on my file: patch does not apply
Ken Tanzer ken.tan...@gmail.com writes: ASCII text, with very long lines, with CRLF, CR, LF line terminators I am not very much surprised if such a file misbehaves, because the format-patch | am pipeline is designed to be used on patches that can be transferred in plain-text e-mail safely. Long lines should probably be OK, but mixed CRLF, CR and LF may be problematic. Having said that... I've confirmed with the following test case on three machines, so it seems reproducible: mkdir temp_test_case cd temp_test_case git init # my file. Sorry--couldn't find a saner link! wget -O jquery-ui-1.8.custom.min.js http://sourceforge.net/p/agency/code/ci/9358ea4dbe8e1540ec0b8bebfc7770f1bf8be0ec/tree/jquery-ui-1.8.custom.min.js?format=raw git add jquery-ui-1.8.custom.min.js git commit -m 'Adding jquery-ui' git rm jquery-ui-1.8.custom.min.js git commit -m 'Removing jquery-ui' git format-patch HEAD~1 git reset --hard HEAD~1 git am 0001* ... this does not break at all for me. -- 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/7] remote-hg: don't decode UTF-8 paths into Unicode objects
On Mon, Nov 11, 2013 at 12:30 PM, Richard Hansen rhan...@bbn.com wrote: On 2013-11-11 06:04, Felipe Contreras wrote: Richard Hansen wrote: The internal mercurial API expects ordinary 8-bit string objects, not Unicode string objects. With this change, the test-hg.sh unit tests pass again. This makes sense to me, but the tests are already passing for me. How are they failing for you? $ hg --version | head -n 1 Mercurial Distributed SCM (version 2.2.2) $ cd ~/git/t $ ../contrib/remote-helpers/test-hg.sh --verbose --immediate Ah, I see they are failing now (v 2.8). I don't know what I was testing. FWIW my tree doesn't have this problem [1]. I can put the above in the commit message if people would like it there. Personally I think it's overkill. You mentioned the tests failed, that's enough explanation. I just wanted to see if that was actually the case. [1] https://travis-ci.org/felipec/git-travis -- Felipe Contreras -- 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 0/4] Remove deprecated commands
John Keeping wrote: On Mon, Nov 11, 2013 at 10:25:51AM -0800, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: git repo-config, git tar-tree, git lost-found and git peek-remote have all been deprecated since at least Git 1.5.4. [...] Probably good material to discuss during the next cycle. [...] I was assuming these would be queued as a held until 2.0 branch, but Please no. :) We already have a nice set of features for 2.0 and I hope people have as few excuses not to upgrade as possible. Anything that actually needs the same kind of treatment that is introduced now should wait for 3.0. Removing repo-config, tar-tree, and peek-remote sounds fine to me (though I haven't thought much about it either way) and I agree that it wouldn't need to wait for an x.0 release. Thanks, Jonathan -- 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 rm / format-patch / am fails on my file: patch does not apply
On 11.11.2013 20:04, Junio C Hamano wrote: Ken Tanzer ken.tan...@gmail.com writes: ASCII text, with very long lines, with CRLF, CR, LF line terminators I am not very much surprised if such a file misbehaves, because the format-patch | am pipeline is designed to be used on patches that can be transferred in plain-text e-mail safely. Long lines should probably be OK, but mixed CRLF, CR and LF may be problematic. Having said that... I've confirmed with the following test case on three machines, so it seems reproducible: mkdir temp_test_case cd temp_test_case git init # my file. Sorry--couldn't find a saner link! wget -O jquery-ui-1.8.custom.min.js http://sourceforge.net/p/agency/code/ci/9358ea4dbe8e1540ec0b8bebfc7770f1bf8be0ec/tree/jquery-ui-1.8.custom.min.js?format=raw git add jquery-ui-1.8.custom.min.js git commit -m 'Adding jquery-ui' git rm jquery-ui-1.8.custom.min.js git commit -m 'Removing jquery-ui' git format-patch HEAD~1 git reset --hard HEAD~1 git am 0001* ... this does not break at all for me. -- Here it breaks, though it doesn't break when using git am --ignore-whitespace 0001* I do have this global config core.safecrlf=warn regarding line endings. I was using 1.8.5.rc1.17.g0ecd94d Trying to understand the problem, Stefan signature.asc Description: OpenPGP digital signature
Re: [PATCH 6/7] test-hg.sh: help user correlate verbose output with email test
On 2013-11-11 06:42, Felipe Contreras wrote: Richard Hansen wrote: It's hard to tell which author conversion test failed when the email addresses look similar. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 84c67ff..5eda265 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -209,16 +209,16 @@ test_expect_success 'authors' ' ../expected author_test alpha H G Wells we...@example.com -author_test beta test test unknown -author_test beta test t...@example.com (comment) test t...@example.com Notice the two betas here in the original code. -author_test gamma t...@example.com Unknown t...@example.com -author_test delta namet...@example.com name t...@example.com -author_test epsilon name t...@example.com name t...@example.com -author_test zeta test test unknown -author_test eta test t...@example.com test t...@example.com -author_test theta test t...@example.com test t...@example.com -author_test iota test test at example dot com test unknown -author_test kappa t...@example.com Unknown t...@example.com +author_test beta beta beta unknown +author_test beta beta t...@example.com (comment) beta t...@example.com Two betas? See above. I can change them to beta1 and beta2, or if you'd prefer I can change them to beta and gamma and increment the subsequent entries. Thanks, Richard +author_test gamma ga...@example.com Unknown ga...@example.com +author_test delta deltat...@example.com delta t...@example.com +author_test epsilon epsilon t...@example.com epsilon t...@example.com +author_test zeta zeta zeta unknown +author_test eta eta t...@example.com eta t...@example.com +author_test theta theta t...@example.com theta t...@example.com +author_test iota iota test at example dot com iota unknown +author_test kappa ka...@example.com Unknown ka...@example.com ) git clone hg::hgrepo gitrepo -- 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 3/7] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
On 2013-11-11 06:37, Felipe Contreras wrote: Richard Hansen wrote: Change 'git push' to 'git push -u remote branch' in one of the test-bzr.sh tests to ensure that the test continues to pass when the default value of push.default changes to simple. This makes sense. Also, explicitly set push.default to simple to silence warnings when using --verbose. This doesn't. Run the tests in t/* and you would seen tons and tons of those warnings, if they should be avoided, they should be avoided for all the tests, why only these? I say drop the second part. Yes it's annoying, but we have to deal with it. OK, will do. Thanks, Richard -- 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 6/7] test-hg.sh: help user correlate verbose output with email test
On Mon, Nov 11, 2013 at 1:19 PM, Richard Hansen rhan...@bbn.com wrote: On 2013-11-11 06:42, Felipe Contreras wrote: Richard Hansen wrote: It's hard to tell which author conversion test failed when the email addresses look similar. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 84c67ff..5eda265 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -209,16 +209,16 @@ test_expect_success 'authors' ' ../expected author_test alpha H G Wells we...@example.com -author_test beta test test unknown -author_test beta test t...@example.com (comment) test t...@example.com Notice the two betas here in the original code. Ahh, that's a bug. -author_test gamma t...@example.com Unknown t...@example.com -author_test delta namet...@example.com name t...@example.com -author_test epsilon name t...@example.com name t...@example.com -author_test zeta test test unknown -author_test eta test t...@example.com test t...@example.com -author_test theta test t...@example.com test t...@example.com -author_test iota test test at example dot com test unknown -author_test kappa t...@example.com Unknown t...@example.com +author_test beta beta beta unknown +author_test beta beta t...@example.com (comment) beta t...@example.com Two betas? See above. I can change them to beta1 and beta2, or if you'd prefer I can change them to beta and gamma and increment the subsequent entries. Yeah, I would prefer that in two patches, one that fixes the sequence, and the other one that changes the emails. If you don't have time for that the original patch is OK by me. The problem with the sequence can be fixed later. Cheers. -- Felipe Contreras -- 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 3/7] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
On Sun, Nov 10, 2013 at 10:05 PM, Richard Hansen rhan...@bbn.com wrote: @@ -379,7 +382,7 @@ test_expect_success 'export utf-8 authors' ' git add content git commit -m one git remote add bzr bzr::../bzrrepo - git push bzr + git push -u bzr master ) Actually, why -u? Isn't 'git push bzr master' enough? -- Felipe Contreras -- 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 rm / format-patch / am fails on my file: patch does not apply
Stefan Beller stefanbel...@googlemail.com writes: I do have this global config core.safecrlf=warn regarding line endings. Oh, that sounds very suspicious. If the payload has CRLF, CR and LF mixed, that would immediately violate safecrlf, so failing the application sounds like the right thing to do. I was using 1.8.5.rc1.17.g0ecd94d Trying to understand the problem, Likewise. Thanks for chiming in. -- 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 rm / format-patch / am fails on my file: patch does not apply
On 11.11.2013 20:37, Junio C Hamano wrote: Stefan Beller stefanbel...@googlemail.com writes: I do have this global config core.safecrlf=warn regarding line endings. Oh, that sounds very suspicious. If the payload has CRLF, CR and LF mixed, that would immediately violate safecrlf, so failing the application sounds like the right thing to do. Not having read the man page, but copied this global config from some '1000 git tips in 5 minutes' years ago, I do expect a setting set to warn to actually not change the program flow except some inserted prints with warnings. I was using 1.8.5.rc1.17.g0ecd94d Trying to understand the problem, Likewise. Thanks for chiming in. Looking at the file we have a mixture of LF/CR, LF only and CR only ending the lines. The formatted patch does have the same file endings on the respective line of that file here. I was trying to change just one line ending to 2 lines (LF CR - LF LF) with a hex editor, so there it becomes a smaller (and more debugable ) patch. I also tried LF - CR and CR - LF, but none of these small changes seem to work. Stefan signature.asc Description: OpenPGP digital signature
Re: [PATCH] git-fetch-pack uses URLs like git-fetch
On 2013-11-11 18.44, Junio C Hamano wrote: Torsten Bögershausen tbo...@web.de writes: git fetch-pack allows [host:]directory to point out the source repository. Use the term repository, which is already used in git fetch or git pull to describe URLs supported by Git. Sign-off? Sorry, forgot -s. If the patch makes sense otherwise, are you willing to squeeze this in: Signed-off-by: Torsten Bögershausen tbo...@web.de --- Documentation/git-fetch-pack.txt | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt index 444b805..93b5067 100644 --- a/Documentation/git-fetch-pack.txt +++ b/Documentation/git-fetch-pack.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--include-tag] [--upload-pack=git-upload-pack] [--depth=n] [--no-progress] -[-v] [host:]directory [refs...] +[-v] repository [refs...] DESCRIPTION --- @@ -97,19 +97,18 @@ be in a separate packet, and the list must end with a flush packet. -v:: Run verbosely. -host:: -A remote host that houses the repository. When this -part is specified, 'git-upload-pack' is invoked via -ssh. - -directory:: -The repository to sync from. +repository:: +The URL to the remote repository. refs...:: The remote heads to update from. This is relative to $GIT_DIR (e.g. HEAD, refs/heads/master). When unspecified, update from all heads the remote side has. +SEE ALSO + +linkgit:git-fetch[1] + GIT --- Part of the linkgit:git[1] suite -- 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 -- 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] git-fetch-pack uses URLs like git-fetch
Torsten Bögershausen tbo...@web.de writes: On 2013-11-11 18.44, Junio C Hamano wrote: Torsten Bögershausen tbo...@web.de writes: git fetch-pack allows [host:]directory to point out the source repository. Use the term repository, which is already used in git fetch or git pull to describe URLs supported by Git. Sign-off? If the patch makes sense otherwise, are you willing to squeeze this in: Signed-off-by: Torsten Bögershausen tbo...@web.de Will do; thanks. -- 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 rm / format-patch / am fails on my file: patch does not apply
On 11.11.2013 20:43, Stefan Beller wrote: On 11.11.2013 20:37, Junio C Hamano wrote: Stefan Beller stefanbel...@googlemail.com writes: I do have this global config core.safecrlf=warn regarding line endings. Oh, that sounds very suspicious. If the payload has CRLF, CR and LF mixed, that would immediately violate safecrlf, so failing the application sounds like the right thing to do. Not having read the man page, but copied this global config from some '1000 git tips in 5 minutes' years ago, I do expect a setting set to warn to actually not change the program flow except some inserted prints with warnings. I was using 1.8.5.rc1.17.g0ecd94d Trying to understand the problem, Likewise. Thanks for chiming in. Looking at the file we have a mixture of LF/CR, LF only and CR only ending the lines. The formatted patch does have the same file endings on the respective line of that file here. I was trying to change just one line ending to 2 lines (LF CR - LF LF) with a hex editor, so there it becomes a smaller (and more debugable ) patch. I also tried LF - CR and CR - LF, but none of these small changes seem to work. Stefan Just having looked at the CRLF conversion code of git, and then at the file again. This file seems to be a special nasty kind, as the number of LFs is equal to the number of CRs in the file (373 of 0x0a and 0x0d each), but only 343 occurences of LF strictly following a CR, so there are 30 CRs and 30 LFs. This shouldn't be as problematic as my first thought was, there is never a direct comparison of stats.cr to stats.lf in convert.c. The CR and LF count are only compared to either the crlf count or 0. Stefan signature.asc Description: OpenPGP digital signature
Re: Bug? diff.submodule=log adds text to commit -v message
Hi Ari, Am 10.11.2013 22:49, schrieb Ari Pollak: I'm using git 1.8.4.2, and I've set the diff.submodule = log option globally. If I change the revision that a submodule is set to, then run git commit -av, The submodule shortlog is appended to the log message without any #s before it, so the log messages get included in my own log message. This seems like a bug and not a feature, as diffs aren't normally included in the commit message with -v. Thanks for your report, I can reproduce that here. But first I think this is unrelated to the diff.submodule = log setting, as without it you'll just see the submodule commit hash diff instead of the shortlog (which is perfectly consistent with what I'd expect from this setting). And secondly what you describe looks like documented behavior, the man page of git commit states: -v, --verbose Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template. Note that this diff output doesn't have its lines prefixed with #. And after adding a modified file the log message also shows the diff of that file (and without leading # s too), so I doubt that diffs aren't normally included in the commit message with -v. What am I missing? Thanks Jens -- 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] git-remote-mediawiki: do not remove installed files in clean target
Matthieu Moy wrote: Jonathan Nieder jrnie...@gmail.com writes: Running make clean after a successful make install should not result in a broken mediawiki remote helper. Acked-by: Matthieu Moy matthieu@imag.fr Thanks for looking it over. Here are a few more makefile tweaks on top of that one. Jonathan Nieder (3): git-remote-mediawiki: honor DESTDIR in make install git-remote-mediawiki build: make 'install' command configurable git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace contrib/mw-to-git/Makefile | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 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/3] git-remote-mediawiki build: make 'install' command configurable
On some machines, the most usable 'install' tool is named 'ginstall'. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- contrib/mw-to-git/Makefile | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile index ee78fda..e685dad 100644 --- a/contrib/mw-to-git/Makefile +++ b/contrib/mw-to-git/Makefile @@ -18,6 +18,8 @@ SCRIPT_PERL+=git-mw.perl GIT_ROOT_DIR=../.. HERE=contrib/mw-to-git/ +INSTALL = install + SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL)) INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \ -s --no-print-directory instlibdir) @@ -30,8 +32,8 @@ test: all check: perlcritic test install_pm: - install -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git - install -m 644 $(GIT_MEDIAWIKI_PM) \ + $(INSTALL) -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git + $(INSTALL) -m 644 $(GIT_MEDIAWIKI_PM) \ $(DESTDIR)$(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) build: -- 1.8.4.1 -- 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/3] git-remote-mediawiki: honor DESTDIR in make install
So now you can run DESTDIR=$(pwd)/tmp make -Ccontrib/mw-to-git install to install the mediawiki remote helper, git-mw tool, and Git::Mediawiki perl module under tmp/ as preparation for zipping it up and extracting on another machine. While at it, make sure the directory that should contain Git::Mediawiki exists before putting a file there. Without this patch, the makefile uses DESTDIR when installing git-mw and git-remote-mediawiki but not the perl module, resulting in errors from make install if the $(INSTLIBDIR)/Git directory does not exist: install: cannot create regular file \ '/usr/share/perl/5.18.1/Git/Mediawiki.pm': No such file or directory Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- contrib/mw-to-git/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile index c5547f9..ee78fda 100644 --- a/contrib/mw-to-git/Makefile +++ b/contrib/mw-to-git/Makefile @@ -30,7 +30,9 @@ test: all check: perlcritic test install_pm: - install $(GIT_MEDIAWIKI_PM) $(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) + install -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git + install -m 644 $(GIT_MEDIAWIKI_PM) \ + $(DESTDIR)$(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) build: $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \ -- 1.8.4.1 -- 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 3/3] git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace
Quote DESTDIR and INSTLIBDIR for the shell in the same way as is done in the toplevel Makefile to avoid confusion in case they contain shell metacharacters. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- contrib/mw-to-git/Makefile | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile index e685dad..a4b6f7a 100644 --- a/contrib/mw-to-git/Makefile +++ b/contrib/mw-to-git/Makefile @@ -23,6 +23,8 @@ INSTALL = install SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL)) INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \ -s --no-print-directory instlibdir) +DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) +INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR)) all: build @@ -32,9 +34,9 @@ test: all check: perlcritic test install_pm: - $(INSTALL) -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/Git' $(INSTALL) -m 644 $(GIT_MEDIAWIKI_PM) \ - $(DESTDIR)$(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) + '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/$(GIT_MEDIAWIKI_PM)' build: $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \ -- 1.8.4.1 -- 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? diff.submodule=log adds text to commit -v message
Jens Lehmann writes: And after adding a modified file the log message also shows the diff of that file (and without leading # s too), so I doubt that diffs aren't normally included in the commit message with -v. What am I missing? Ah, it is true that -v normally does not prefix the diffs with #, but there must be some filter in place after I save quit my editor when a normal file diff is present, since that does not get included in the final commit message. But the submodule log does get included, which does not seem intentional. Cheers, Ari -- 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] l10n: de.po: translate 68 new messages
Ralf Thielow ralf.thie...@gmail.com writes: Translate 68 new messages came from git.pot update in 727b957 (l10n: git.pot: v1.8.5 round 1 (68 new, 9 removed)). Signed-off-by: Ralf Thielow ralf.thie...@gmail.com Acked-by: Thomas Rast t...@thomasrast.ch Thanks for your work! -- 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
[PATCH] submodule update: remove unnecessary orig_flags variable
cmd_update() in the submodule script tries to preserve the options given on the command line in the orig_flags variable to pass them on into the recursion when the '--recursive' option is given. But this isn't necessary because all the variables set by the options will be seen in the recursion too as that is achieved by executing eval cmd_update. The same has already been done for cmd_status() in e15bec0ec, so let's clean up cmd_update() likewise. Also add a test to make sure that a submodule name given on the command line is not passed into the recursion (which was the goal of adding the orig_flags variable in 98dbe63db). Signed-off-by: Jens Lehmann jens.lehm...@web.de --- git-submodule.sh| 5 + t/t7406-submodule-update.sh | 11 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 896f1c9..74cbc53 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -706,7 +706,6 @@ cmd_deinit() cmd_update() { # parse $args after submodule ... update. - orig_flags= while test $# -ne 0 do case $1 in @@ -731,7 +730,6 @@ cmd_update() --reference) case $2 in '') usage ;; esac reference=--reference=$2 - orig_flags=$orig_flags $(git rev-parse --sq-quote $1) shift ;; --reference=*) @@ -765,7 +763,6 @@ cmd_update() break ;; esac - orig_flags=$orig_flags $(git rev-parse --sq-quote $1) shift done @@ -909,7 +906,7 @@ Maybe you want to use 'update --init'?) prefix=$prefix$sm_path/ clear_local_git_env cd $sm_path - eval cmd_update $orig_flags + eval cmd_update ) res=$? if test $res -gt 0 diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index f0b3305..2d9db8e 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -747,6 +747,17 @@ test_expect_success 'submodule update clone shallow submodule' ' (cd submodule test 1 = $(git log --oneline | wc -l) ) +) +' + +test_expect_success 'submodule update --recursive drops module name before recursing' ' + (cd super2 +(cd deeper/submodule/subsubmodule + git checkout HEAD^ +) +git submodule update --recursive deeper/submodule actual +test_i18ngrep Submodule path .deeper/submodule/subsubmodule.: checked out actual ) ' + test_done -- 1.8.5.rc1.18.g384525a.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: [RFC/PATCH 0/4] Remove deprecated commands
On Mon, Nov 11, 2013 at 11:13:45AM -0800, Jonathan Nieder wrote: John Keeping wrote: On Mon, Nov 11, 2013 at 10:25:51AM -0800, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: git repo-config, git tar-tree, git lost-found and git peek-remote have all been deprecated since at least Git 1.5.4. [...] Probably good material to discuss during the next cycle. [...] I was assuming these would be queued as a held until 2.0 branch, but Please no. :) We already have a nice set of features for 2.0 and I hope people have as few excuses not to upgrade as possible. Anything that actually needs the same kind of treatment that is introduced now should wait for 3.0. Removing repo-config, tar-tree, and peek-remote sounds fine to me (though I haven't thought much about it either way) and I agree that it wouldn't need to wait for an x.0 release. For git repo-config, the 1.5.4 release notes say that it will be removed in the next feature release. I'm not sure what a feature release is, but if 1.6.0 wasn't one, then I think 2.0 will be the next one. Although, I now see that howto/maintain-git.txt says a feature release is numbered vX.Y.Z, so perhaps it should have been removed long before now... -- 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 3/7] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
On 2013-11-11 14:31, Felipe Contreras wrote: On Sun, Nov 10, 2013 at 10:05 PM, Richard Hansen rhan...@bbn.com wrote: @@ -379,7 +382,7 @@ test_expect_success 'export utf-8 authors' ' git add content git commit -m one git remote add bzr bzr::../bzrrepo - git push bzr + git push -u bzr master ) Actually, why -u? Isn't 'git push bzr master' enough? It's defensive in case that test is ever updated to do more pushing. I can leave it out in the reroll. -Richard -- 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 6/7] test-hg.sh: help user correlate verbose output with email test
On 2013-11-11 14:29, Felipe Contreras wrote: On Mon, Nov 11, 2013 at 1:19 PM, Richard Hansen rhan...@bbn.com wrote: On 2013-11-11 06:42, Felipe Contreras wrote: Richard Hansen wrote: It's hard to tell which author conversion test failed when the email addresses look similar. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 84c67ff..5eda265 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -209,16 +209,16 @@ test_expect_success 'authors' ' ../expected author_test alpha H G Wells we...@example.com -author_test beta test test unknown -author_test beta test t...@example.com (comment) test t...@example.com Notice the two betas here in the original code. Ahh, that's a bug. -author_test gamma t...@example.com Unknown t...@example.com -author_test delta namet...@example.com name t...@example.com -author_test epsilon name t...@example.com name t...@example.com -author_test zeta test test unknown -author_test eta test t...@example.com test t...@example.com -author_test theta test t...@example.com test t...@example.com -author_test iota test test at example dot com test unknown -author_test kappa t...@example.com Unknown t...@example.com +author_test beta beta beta unknown +author_test beta beta t...@example.com (comment) beta t...@example.com Two betas? See above. I can change them to beta1 and beta2, or if you'd prefer I can change them to beta and gamma and increment the subsequent entries. Yeah, I would prefer that in two patches, one that fixes the sequence, and the other one that changes the emails. Will do. Thanks, Richard If you don't have time for that the original patch is OK by me. The problem with the sequence can be fixed later. Cheers. -- 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 3/7] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
On Mon, Nov 11, 2013 at 3:16 PM, Richard Hansen rhan...@bbn.com wrote: On 2013-11-11 14:31, Felipe Contreras wrote: On Sun, Nov 10, 2013 at 10:05 PM, Richard Hansen rhan...@bbn.com wrote: @@ -379,7 +382,7 @@ test_expect_success 'export utf-8 authors' ' git add content git commit -m one git remote add bzr bzr::../bzrrepo - git push bzr + git push -u bzr master ) Actually, why -u? Isn't 'git push bzr master' enough? It's defensive in case that test is ever updated to do more pushing. I can leave it out in the reroll. Please do. If there's any need for that we can add it later, but even then I would prefer that the push explicit again, like this one. And suspect we will not need to update this in that direction. -- Felipe Contreras -- 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] git-remote-mediawiki: do not remove installed files in clean target
Jonathan Nieder jrnie...@gmail.com writes: Matthieu Moy wrote: Jonathan Nieder jrnie...@gmail.com writes: Running make clean after a successful make install should not result in a broken mediawiki remote helper. Acked-by: Matthieu Moy matthieu@imag.fr Thanks for looking it over. Here are a few more makefile tweaks on top of that one. All look good to me. Is it intentional that you didn't Cc Junio? -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- 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? diff.submodule=log adds text to commit -v message
Am 11.11.2013 21:48, schrieb Ari Pollak: Jens Lehmann writes: And after adding a modified file the log message also shows the diff of that file (and without leading # s too), so I doubt that diffs aren't normally included in the commit message with -v. What am I missing? Ah, it is true that -v normally does not prefix the diffs with #, but there must be some filter in place after I save quit my editor when a normal file diff is present, since that does not get included in the final commit message. But the submodule log does get included, which does not seem intentional. Ok, now this makes sense. git commit strips off the diff added by -v by skipping everything starting with \ndiff --git . But that logic fails when the diff.submodule = log setting adds a shortlog instead of a regular diff, as that starts with \nSubmodule . The diff below fixes the problem you describe for me. (But I do not consider it a worthwhile fix in its current form because a line starting with Submodule might appear in a perfectly normal commit message, while diff --git most probably won't). And while testing this issue I noticed another problem: When using git commit -a not only the staged commits of a submodule get committed, but also the unstaged commits. Will look into that too. -8- diff --git a/builtin/commit.c b/builtin/commit.c index 6ab4605..ff6e171 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1600,11 +1600,14 @@ int cmd_commit(int argc, const char **argv, const char * die(_(could not read commit message: %s), strerror(saved_errno } - /* Truncate the message just before the diff, if any. */ + /* Truncate the message just before the diff or submodule shortlog */ if (verbose) { p = strstr(sb.buf, \ndiff --git ); if (p != NULL) strbuf_setlen(sb, p - sb.buf + 1); + p = strstr(sb.buf, \nSubmodule ); + if (p != NULL) + strbuf_setlen(sb, p - sb.buf + 1); } if (cleanup_mode != CLEANUP_NONE) -- 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? diff.submodule=log adds text to commit -v message
Am 11.11.2013 22:29, schrieb Jens Lehmann: And while testing this issue I noticed another problem: When using git commit -a not only the staged commits of a submodule get committed, but also the unstaged commits. Will look into that too. Ok, scrap that. This is exactly what is expected. -- 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: What's cooking in git.git (Nov 2013, #01; Fri, 1)
Junio C Hamano gits...@pobox.com writes: Commit ad24a30ef (fast-export: add new --refspec option, 31-10-2013) causes sparse to complain: SP builtin/fast-export.c builtin/fast-export.c:739:55: warning: Variable length array is used. Do we want to use this C99 feature? Good eyes, and no---this needs to be fixed before going forward. Thanks for spotting. I'm tempted to squash this in to the problematic commit, if nobody comes up with a better fix soonish, before merging the series to 'next'. builtin/fast-export.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 8ed41b4..7d02f63 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -736,9 +736,10 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) usage_with_options (fast_export_usage, options); if (refspecs_list.nr) { - const char *refspecs_str[refspecs_list.nr]; + const char **refspecs_str; int i; + refspecs_str = xmalloc(sizeof(const char *) * refspecs_list.nr); for (i = 0; i refspecs_list.nr; i++) refspecs_str[i] = refspecs_list.items[i].string; @@ -746,6 +747,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) refspecs = parse_fetch_refspec(refspecs_nr, refspecs_str); string_list_clear(refspecs_list, 1); + free(refspecs_str); } if (use_done_feature) -- 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 v6 00/10] transport-helper: updates
Hi, Here are the patches that allow transport helpers to be completely transparent; renaming branches, deleting them, custom refspecs, --force, --dry-run, reporting forced update, everything works. Small changes since v5: diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 8ed41b4..4b76222 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -736,9 +736,10 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) usage_with_options (fast_export_usage, options); if (refspecs_list.nr) { - const char *refspecs_str[refspecs_list.nr]; + const char **refspecs_str; int i; + refspecs_str = xmalloc(sizeof(*refspecs_str) * refspecs_list.nr); for (i = 0; i refspecs_list.nr; i++) refspecs_str[i] = refspecs_list.items[i].string; @@ -746,6 +747,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) refspecs = parse_fetch_refspec(refspecs_nr, refspecs_str); string_list_clear(refspecs_list, 1); + free(refspecs_str); } if (use_done_feature) diff --git a/git-remote-testgit.sh b/git-remote-testgit.sh index 716aa4c..1c006a0 100755 --- a/git-remote-testgit.sh +++ b/git-remote-testgit.sh @@ -15,6 +15,8 @@ test -z $refspec prefix=refs export GIT_DIR=$url/.git +force= + mkdir -p $dir if test -z $GIT_REMOTE_TESTGIT_NO_MARKS Felipe Contreras (10): transport-helper: fix extra lines transport-helper: don't update refs in dry-run transport-helper: add 'force' to 'export' helpers transport-helper: check for 'forced update' message fast-export: improve argument parsing fast-export: add new --refspec option transport-helper: add support for old:new refspec fast-import: add support to delete refs fast-export: add support to delete refs transport-helper: add support to delete branches Documentation/git-fast-export.txt | 4 +++ Documentation/git-fast-import.txt | 3 +++ Documentation/gitremote-helpers.txt | 4 +++ builtin/fast-export.c | 49 - fast-import.c | 13 +++--- git-remote-testgit.sh | 18 ++ t/t5801-remote-helpers.sh | 23 - t/t9300-fast-import.sh | 18 ++ t/t9350-fast-export.sh | 18 ++ transport-helper.c | 47 +++ 10 files changed, 177 insertions(+), 20 deletions(-) -- 1.8.4.2+fc1 -- 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 v6 01/10] transport-helper: fix extra lines
Commit 9c51558 (transport-helper: trivial code shuffle) moved these lines above, but 99d9ec0 (Merge branch 'fc/transport-helper-no-refspec') had a wrong merge conflict and readded them. Reported-by: Richard Hansen rhan...@bbn.com Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- transport-helper.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index 673b7c2..b66c7fd 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -875,9 +875,6 @@ static int push_refs_with_export(struct transport *transport, } free(private); - if (ref-deletion) - die(remote-helpers do not support ref deletion); - if (ref-peer_ref) { if (strcmp(ref-peer_ref-name, ref-name)) die(remote-helpers do not support old:new syntax); -- 1.8.4.2+fc1 -- 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 v6 06/10] fast-export: add new --refspec option
So that we can convert the exported ref names. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Documentation/git-fast-export.txt | 4 builtin/fast-export.c | 32 t/t9350-fast-export.sh| 7 +++ 3 files changed, 43 insertions(+) diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt index 85f1f30..221506b 100644 --- a/Documentation/git-fast-export.txt +++ b/Documentation/git-fast-export.txt @@ -105,6 +105,10 @@ marks the same across runs. in the commit (as opposed to just listing the files which are different from the commit's first parent). +--refspec:: + Apply the specified refspec to each ref exported. Multiple of them can + be specified. + [git-rev-list-args...]:: A list of arguments, acceptable to 'git rev-parse' and 'git rev-list', that specifies the specific objects and references diff --git a/builtin/fast-export.c b/builtin/fast-export.c index eea5b8c..cf745ec 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -17,6 +17,7 @@ #include utf8.h #include parse-options.h #include quote.h +#include remote.h static const char *fast_export_usage[] = { N_(git fast-export [rev-list-opts]), @@ -31,6 +32,8 @@ static int use_done_feature; static int no_data; static int full_tree; static struct string_list extra_refs = STRING_LIST_INIT_NODUP; +static struct refspec *refspecs; +static int refspecs_nr; static int parse_opt_signed_tag_mode(const struct option *opt, const char *arg, int unset) @@ -525,6 +528,15 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info) if (dwim_ref(e-name, strlen(e-name), sha1, full_name) != 1) continue; + if (refspecs) { + char *private; + private = apply_refspecs(refspecs, refspecs_nr, full_name); + if (private) { + free(full_name); + full_name = private; + } + } + commit = get_commit(e, full_name); if (!commit) { warning(%s: Unexpected object of type %s, skipping., @@ -668,6 +680,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) struct commit *commit; char *export_filename = NULL, *import_filename = NULL; uint32_t lastimportid; + struct string_list refspecs_list = STRING_LIST_INIT_NODUP; struct option options[] = { OPT_INTEGER(0, progress, progress, N_(show progress after n objects)), @@ -688,6 +701,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) OPT_BOOL(0, use-done-feature, use_done_feature, N_(Use the done feature to terminate the stream)), OPT_BOOL(0, no-data, no_data, N_(Skip output of blob data)), + OPT_STRING_LIST(0, refspec, refspecs_list, N_(refspec), +N_(Apply refspec to exported refs)), OPT_END() }; @@ -707,6 +722,21 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) if (argc 1) usage_with_options (fast_export_usage, options); + if (refspecs_list.nr) { + const char **refspecs_str; + int i; + + refspecs_str = xmalloc(sizeof(*refspecs_str) * refspecs_list.nr); + for (i = 0; i refspecs_list.nr; i++) + refspecs_str[i] = refspecs_list.items[i].string; + + refspecs_nr = refspecs_list.nr; + refspecs = parse_fetch_refspec(refspecs_nr, refspecs_str); + + string_list_clear(refspecs_list, 1); + free(refspecs_str); + } + if (use_done_feature) printf(feature done\n); @@ -741,5 +771,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) if (use_done_feature) printf(done\n); + free_refspec(refspecs_nr, refspecs); + return 0; } diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index 2312dec..3d475af 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -504,4 +504,11 @@ test_expect_success 'refs are updated even if no commits need to be exported' ' test_cmp expected actual ' +test_expect_success 'use refspec' ' + git fast-export --refspec refs/heads/master:refs/heads/foobar master | \ + grep ^commit | sort | uniq actual + echo commit refs/heads/foobar expected + test_cmp expected actual +' + test_done -- 1.8.4.2+fc1 -- 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 v6 05/10] fast-export: improve argument parsing
We don't want to pass arguments specific to fast-export to setup_revisions. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- builtin/fast-export.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 78250ea..eea5b8c 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -701,8 +701,9 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) revs.topo_order = 1; revs.show_source = 1; revs.rewrite_parents = 1; + argc = parse_options(argc, argv, prefix, options, fast_export_usage, + PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN); argc = setup_revisions(argc, argv, revs, NULL); - argc = parse_options(argc, argv, prefix, options, fast_export_usage, 0); if (argc 1) usage_with_options (fast_export_usage, options); -- 1.8.4.2+fc1 -- 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 v6 10/10] transport-helper: add support to delete branches
For remote-helpers that use 'export' to push. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- t/t5801-remote-helpers.sh | 8 transport-helper.c| 11 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 454337e..c667965 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -94,6 +94,14 @@ test_expect_success 'push new branch with old:new refspec' ' compare_refs local HEAD server refs/heads/new-refspec ' +test_expect_success 'push delete branch' ' + (cd local +git push origin :new-name + ) + test_must_fail git --git-dir=server/.git \ +rev-parse --verify refs/heads/new-name +' + test_expect_success 'forced push' ' (cd local git checkout -b force-test diff --git a/transport-helper.c b/transport-helper.c index 7411125..2257588 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -876,9 +876,6 @@ static int push_refs_with_export(struct transport *transport, char *private; unsigned char sha1[20]; - if (ref-deletion) - die(remote-helpers do not support ref deletion); - private = apply_refspecs(data-refspecs, data-refspec_nr, ref-name); if (private !get_sha1(private, sha1)) { strbuf_addf(buf, ^%s, private); @@ -890,12 +887,16 @@ static int push_refs_with_export(struct transport *transport, if (ref-peer_ref) { if (strcmp(ref-name, ref-peer_ref-name)) { struct strbuf buf = STRBUF_INIT; - strbuf_addf(buf, %s:%s, ref-peer_ref-name, ref-name); + if (!ref-deletion) + strbuf_addf(buf, %s:%s, ref-peer_ref-name, ref-name); + else + strbuf_addf(buf, :%s, ref-name); string_list_append(revlist_args, --refspec); string_list_append(revlist_args, buf.buf); strbuf_release(buf); } - string_list_append(revlist_args, ref-peer_ref-name); + if (!ref-deletion) + string_list_append(revlist_args, ref-peer_ref-name); } } -- 1.8.4.2+fc1 -- 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 v6 08/10] fast-import: add support to delete refs
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Documentation/git-fast-import.txt | 3 +++ fast-import.c | 13 ++--- t/t9300-fast-import.sh| 18 ++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index 73f9806..2ffae42 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -483,6 +483,9 @@ Marks must be declared (via `mark`) before they can be used. * Any valid Git SHA-1 expression that resolves to a commit. See ``SPECIFYING REVISIONS'' in linkgit:gitrevisions[7] for details. +* The special null SHA-1 (40 zeros) specifies that the branch is to be + removed. + The special case of restarting an incremental import from the current branch value should be written as: diff --git a/fast-import.c b/fast-import.c index f4d9969..fdce0b7 100644 --- a/fast-import.c +++ b/fast-import.c @@ -248,6 +248,7 @@ struct branch { uintmax_t last_commit; uintmax_t num_notes; unsigned active : 1; + unsigned delete : 1; unsigned pack_id : PACK_ID_BITS; unsigned char sha1[20]; }; @@ -1690,10 +1691,13 @@ static int update_branch(struct branch *b) struct ref_lock *lock; unsigned char old_sha1[20]; - if (is_null_sha1(b-sha1)) - return 0; if (read_ref(b-name, old_sha1)) hashclr(old_sha1); + if (is_null_sha1(b-sha1)) { + if (b-delete) + delete_ref(b-name, old_sha1, 0); + return 0; + } lock = lock_any_ref_for_update(b-name, old_sha1, 0, NULL); if (!lock) return error(Unable to lock %s, b-name); @@ -2620,8 +2624,11 @@ static int parse_from(struct branch *b) free(buf); } else parse_from_existing(b); - } else if (!get_sha1(from, b-sha1)) + } else if (!get_sha1(from, b-sha1)) { parse_from_existing(b); + if (is_null_sha1(b-sha1)) + b-delete = 1; + } else die(Invalid ref name or SHA1 expression: %s, from); diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 27263df..5fc9ef2 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -2999,4 +2999,22 @@ test_expect_success 'T: ls root tree' ' test_cmp expect actual ' +test_expect_success 'T: delete branch' ' + git branch to-delete + git fast-import -EOF + reset refs/heads/to-delete + from + EOF + test_must_fail git rev-parse --verify refs/heads/to-delete +' + +test_expect_success 'T: empty reset doesnt delete branch' ' + git branch not-to-delete + git fast-import -EOF + reset refs/heads/not-to-delete + EOF + git show-ref + git rev-parse --verify refs/heads/not-to-delete +' + test_done -- 1.8.4.2+fc1 -- 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 v6 09/10] fast-export: add support to delete refs
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- builtin/fast-export.c | 14 ++ t/t9350-fast-export.sh | 11 +++ 2 files changed, 25 insertions(+) diff --git a/builtin/fast-export.c b/builtin/fast-export.c index cf745ec..4b76222 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -673,6 +673,19 @@ static void import_marks(char *input_file) fclose(f); } +static void handle_deletes(void) +{ + int i; + for (i = 0; i refspecs_nr; i++) { + struct refspec *refspec = refspecs[i]; + if (*refspec-src) + continue; + + printf(reset %s\nfrom %s\n\n, + refspec-dst, sha1_to_hex(null_sha1)); + } +} + int cmd_fast_export(int argc, const char **argv, const char *prefix) { struct rev_info revs; @@ -764,6 +777,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) } handle_tags_and_duplicates(); + handle_deletes(); if (export_filename lastimportid != last_idnum) export_marks(export_filename); diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index 3d475af..66c8b0a 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -511,4 +511,15 @@ test_expect_success 'use refspec' ' test_cmp expected actual ' +test_expect_success 'delete refspec' ' + git branch to-delete + git fast-export --refspec :refs/heads/to-delete to-delete ^to-delete actual + cat expected -EOF + reset refs/heads/to-delete + from + + EOF + test_cmp expected actual +' + test_done -- 1.8.4.2+fc1 -- 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 v6 03/10] transport-helper: add 'force' to 'export' helpers
Otherwise they cannot know when to force the push or not (other than hacks). Tests-by: Richard Hansen rhan...@bbn.com Documentation-by: Richard Hansen rhan...@bbn.com Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Documentation/gitremote-helpers.txt | 4 git-remote-testgit.sh | 18 ++ t/t5801-remote-helpers.sh | 13 + transport-helper.c | 5 + 4 files changed, 40 insertions(+) diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt index f1f4ca9..e75699c 100644 --- a/Documentation/gitremote-helpers.txt +++ b/Documentation/gitremote-helpers.txt @@ -437,6 +437,10 @@ set by Git if the remote helper has the 'option' capability. 'option check-connectivity' \{'true'|'false'\}:: Request the helper to check connectivity of a clone. +'option force' \{'true'|'false'\}:: + Request the helper to perform a force update. Defaults to + 'false'. + SEE ALSO linkgit:git-remote[1] diff --git a/git-remote-testgit.sh b/git-remote-testgit.sh index 6d2f282..1c006a0 100755 --- a/git-remote-testgit.sh +++ b/git-remote-testgit.sh @@ -15,6 +15,8 @@ test -z $refspec prefix=refs export GIT_DIR=$url/.git +force= + mkdir -p $dir if test -z $GIT_REMOTE_TESTGIT_NO_MARKS @@ -39,6 +41,7 @@ do fi test -n $GIT_REMOTE_TESTGIT_SIGNED_TAGS echo signed-tags test -n $GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE echo no-private-update + echo 'option' echo ;; list) @@ -93,6 +96,7 @@ do before=$(git for-each-ref --format=' %(refname) %(objectname) ') git fast-import \ + ${force:+--force} \ ${testgitmarks:+--import-marks=$testgitmarks} \ ${testgitmarks:+--export-marks=$testgitmarks} \ --quiet @@ -115,6 +119,20 @@ do echo ;; + option\ *) + read cmd opt val -EOF + $line + EOF + case $opt in + force) + test $val = true force=true || force= + echo ok + ;; + *) + echo unsupported + ;; + esac + ;; '') exit ;; diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 613f69a..c33cc25 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -94,6 +94,19 @@ test_expect_failure 'push new branch with old:new refspec' ' compare_refs local HEAD server refs/heads/new-refspec ' +test_expect_success 'forced push' ' + (cd local + git checkout -b force-test + echo content file + git commit -a -m eight + git push origin force-test + echo content file + git commit -a --amend -m eight-modified + git push --force origin force-test + ) + compare_refs local refs/heads/force-test server refs/heads/force-test +' + test_expect_success 'cloning without refspec' ' GIT_REMOTE_TESTGIT_REFSPEC= \ git clone testgit::${PWD}/server local2 2error diff --git a/transport-helper.c b/transport-helper.c index 9558a0d..bead9b9 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -855,6 +855,11 @@ static int push_refs_with_export(struct transport *transport, die(helper %s does not support dry-run, data-name); } + if (flags TRANSPORT_PUSH_FORCE) { + if (set_helper_option(transport, force, true) != 0) + die(helper %s does not support 'force', data-name); + } + helper = get_helper(transport); write_constant(helper-in, export\n); -- 1.8.4.2+fc1 -- 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 v6 02/10] transport-helper: don't update refs in dry-run
The remote helper namespace should not be updated. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- transport-helper.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index b66c7fd..9558a0d 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -728,7 +728,8 @@ static int push_update_ref_status(struct strbuf *buf, } static void push_update_refs_status(struct helper_data *data, - struct ref *remote_refs) + struct ref *remote_refs, + int flags) { struct strbuf buf = STRBUF_INIT; struct ref *ref = remote_refs; @@ -742,7 +743,7 @@ static void push_update_refs_status(struct helper_data *data, if (push_update_ref_status(buf, ref, remote_refs)) continue; - if (!data-refspecs || data-no_private_update) + if (flags TRANSPORT_PUSH_DRY_RUN || !data-refspecs || data-no_private_update) continue; /* propagate back the update to the remote namespace */ @@ -833,7 +834,7 @@ static int push_refs_with_push(struct transport *transport, sendline(data, buf); strbuf_release(buf); - push_update_refs_status(data, remote_refs); + push_update_refs_status(data, remote_refs, flags); return 0; } @@ -887,7 +888,7 @@ static int push_refs_with_export(struct transport *transport, if (finish_command(exporter)) die(Error while running fast-export); - push_update_refs_status(data, remote_refs); + push_update_refs_status(data, remote_refs, flags); return 0; } -- 1.8.4.2+fc1 -- 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 v6 07/10] transport-helper: add support for old:new refspec
By using fast-export's new --refspec option. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- t/t5801-remote-helpers.sh | 2 +- transport-helper.c| 13 ++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index c33cc25..454337e 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -87,7 +87,7 @@ test_expect_success 'push new branch by name' ' compare_refs local HEAD server refs/heads/new-name ' -test_expect_failure 'push new branch with old:new refspec' ' +test_expect_success 'push new branch with old:new refspec' ' (cd local git push origin new-name:new-refspec ) diff --git a/transport-helper.c b/transport-helper.c index 9a5814d..7411125 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -850,7 +850,7 @@ static int push_refs_with_export(struct transport *transport, struct ref *ref; struct child_process *helper, exporter; struct helper_data *data = transport-data; - struct string_list revlist_args = STRING_LIST_INIT_NODUP; + struct string_list revlist_args = STRING_LIST_INIT_DUP; struct strbuf buf = STRBUF_INIT; if (!data-refspecs) @@ -888,8 +888,13 @@ static int push_refs_with_export(struct transport *transport, free(private); if (ref-peer_ref) { - if (strcmp(ref-peer_ref-name, ref-name)) - die(remote-helpers do not support old:new syntax); + if (strcmp(ref-name, ref-peer_ref-name)) { + struct strbuf buf = STRBUF_INIT; + strbuf_addf(buf, %s:%s, ref-peer_ref-name, ref-name); + string_list_append(revlist_args, --refspec); + string_list_append(revlist_args, buf.buf); + strbuf_release(buf); + } string_list_append(revlist_args, ref-peer_ref-name); } } @@ -897,6 +902,8 @@ static int push_refs_with_export(struct transport *transport, if (get_exporter(transport, exporter, revlist_args)) die(Couldn't run fast-export); + string_list_clear(revlist_args, 1); + if (finish_command(exporter)) die(Error while running fast-export); push_update_refs_status(data, remote_refs, flags); -- 1.8.4.2+fc1 -- 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
What's cooking in git.git (Nov 2013, #03; Mon, 11)
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -- [New Topics] * kb/doc-exclude-directory-semantics (2013-11-07) 1 commit - gitignore.txt: clarify recursive nature of excluded directories Will merge to 'next'. * jc/create-directories-microopt (2013-11-11) 1 commit - checkout: most of the time we have good leading directories Of unknown value until tested on non-Linux platforms (especially Windows). Will hold. * jl/submodule-update-retire-orig-flags (2013-11-11) 1 commit - submodule update: remove unnecessary orig_flags variable Code clean-up. Will merge to 'next'. * jn/mediawiki-makefile-updates (2013-11-11) 4 commits - git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace - git-remote-mediawiki build: make 'install' command configurable - git-remote-mediawiki: honor DESTDIR in make install - git-remote-mediawiki: do not remove installed files in clean target Build and Installation procedure clean-up. Will merge to 'next'. * tb/doc-fetch-pack-url (2013-11-11) 1 commit - git-fetch-pack uses URLs like git-fetch Will merge to 'next'. -- [Stalled] * cn/thin-push-capability (2013-11-06) 2 commits - send-pack: only send a thin pack if the server supports it - receive-pack: advertise thin-pack Peff had a good suggestion to control this by expressing what the receiving end wants in a more direct way, namely to advertise a 'no-thin' trait in the capability list, which seems to be favored by Shawn, too. * jt/commit-fixes-footer (2013-10-30) 1 commit - commit: Add -f, --fixes commit option to add Fixes: line There is an ongoing discussion around this topic; in general I am fairly negative on a new feature that is too narrow and prefer a more generic solution that can be tailored for specific needs, as many people stated in the thread. It appears that the discussion stalled. * np/pack-v4 (2013-09-18) 90 commits . packv4-parse.c: add tree offset caching . t1050: replace one instance of show-index with verify-pack . index-pack, pack-objects: allow creating .idx v2 with .pack v4 . unpack-objects: decode v4 trees . unpack-objects: allow to save processed bytes to a buffer - ... Nico and Duy advancing the eternal vaporware pack-v4. This is here primarily for wider distribution of the preview edition. Temporarily ejected from 'pu', to try out jk/pack-bitmap, which this topic conflicts with. * jk/pack-bitmap (2013-10-30) 20 commits - count-objects: recognize .bitmap in garbage-checking - pack-bitmap: implement optional name_hash cache - t: add basic bitmap functionality tests - repack: consider bitmaps when performing repacks - repack: handle optional files created by pack-objects - repack: turn exts array into array-of-struct - repack: stop using magic number for ARRAY_SIZE(exts) - pack-objects: implement bitmap writing - rev-list: add bitmap mode to speed up object lists - pack-objects: use bitmaps when packing objects - pack-bitmap: add support for bitmap indexes - documentation: add documentation for the bitmap format - ewah: compressed bitmap implementation - compat: add endianness helpers - sha1_file: export `git_open_noatime` - revision: allow setting custom limiter function - pack-objects: factor out name_hash - pack-objects: refactor the packing list - revindex: export new APIs - sha1write: make buffer const-correct Borrows the bitmap index into packfiles from JGit to speed up enumeration of objects involved in a commit range without having to fully traverse the history. Waiting for a reroll. * mf/graph-show-root (2013-10-25) 1 commit . graph.c: mark root commit differently In a repository with multiple-roots, log --graph, especially with --oneline, does not give the reader enough visual cue to see where one line of history ended and a separate history began. This is the version that marks the roots 'x' when they would have been marked as '*'; Keshav Kini suggested an alternative of giving an extra blank line after every root, which I tend to think is a better approach to the problem. * tg/perf-lib-test-perf-cleanup (2013-09-19) 2 commits - perf-lib: add test_perf_cleanup target - perf-lib: split starting the test from the execution Add test_perf_cleanup shell function to the perf suite, that allows the script writers to define a test with a clean-up action. Holding until needed. * yt/shortened-rename (2013-10-18) 2 commits - SQUASH??? style fixes and s/omit/shorten/ where appropriate - diff.c: keep arrow(=) on show_stats()'s shortened filename part to make rename visible Attempts to give more weight on the fact
Re: Bug? diff.submodule=log adds text to commit -v message
On Mon, Nov 11, 2013 at 10:29:25PM +0100, Jens Lehmann wrote: The diff below fixes the problem you describe for me. (But I do not consider it a worthwhile fix in its current form because a line starting with Submodule might appear in a perfectly normal commit message, while diff --git most probably won't). Yeah, this fix makes me nervous for that reason. commit -v has always been a little bit flaky in that respect, as it is simply guessing at the beginning of the diff text it added earlier. In addition to false negatives, it also has false positives, stripping out people's diffs that they meant to include in the commit message. The right way to fix this is to change the format to use some more robust marker, like: # Everything below this line is a diff that will be removed. I do not know offhand if anybody's commit-template generating or parsing scripts would be broken, but I doubt the fallout would be that big. When last we discussed this (AFAICT), we did not yet have 0b38227 (commit: Fix stripping of patch in verbose mode., 2008-11-12), which meant that it would affect _everybody_. Nowadays it would only affect users of -v, which is presumably a much smaller population. -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 v6 00/10] transport-helper: updates
Felipe Contreras felipe.contre...@gmail.com writes: Here are the patches that allow transport helpers to be completely transparent; renaming branches, deleting them, custom refspecs, --force, --dry-run, reporting forced update, everything works. How are you sending your patches? The Message-ID's suggest that git-send-email is being used, but when the patches are ordered by the sender datestamp, they seem to come out in a random order, unlike the patches other people send with git-send-email. git-send-email gives a timestamp to the first message it sends out and then gives consecutive timestamps, one second apart, to subsequent messages, in order to make this sorting by sender timestamp on Date: field work. I am wondering if there is something you are doing differently, and/or if there is something that needs to be fixed in the version of git-send-email you are using. Thanks. -- 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 v6 06/10] fast-export: add new --refspec option
Felipe Contreras felipe.contre...@gmail.com writes: So that we can convert the exported ref names. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- I thought that the discussion agreed this option should not be called --refspec but something like --refmap? -- 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 v6 03/10] transport-helper: add 'force' to 'export' helpers
Felipe Contreras felipe.contre...@gmail.com writes: Otherwise they cannot know when to force the push or not (other than hacks). Tests-by: Richard Hansen rhan...@bbn.com Documentation-by: Richard Hansen rhan...@bbn.com Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Didn't we agree that this should be warn, not die? + if (flags TRANSPORT_PUSH_FORCE) { + if (set_helper_option(transport, force, true) != 0) + die(helper %s does not support 'force', data-name); + } + helper = get_helper(transport); write_constant(helper-in, export\n); -- 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 v6 00/10] transport-helper: updates
Felipe Contreras felipe.contre...@gmail.com writes: Small changes since v5: diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 8ed41b4..4b76222 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -736,9 +736,10 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) usage_with_options (fast_export_usage, options); if (refspecs_list.nr) { - const char *refspecs_str[refspecs_list.nr]; + const char **refspecs_str; int i; + refspecs_str = xmalloc(sizeof(*refspecs_str) * refspecs_list.nr); for (i = 0; i refspecs_list.nr; i++) refspecs_str[i] = refspecs_list.items[i].string; @@ -746,6 +747,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) refspecs = parse_fetch_refspec(refspecs_nr, refspecs_str); string_list_clear(refspecs_list, 1); + free(refspecs_str); } if (use_done_feature) diff --git a/git-remote-testgit.sh b/git-remote-testgit.sh index 716aa4c..1c006a0 100755 --- a/git-remote-testgit.sh +++ b/git-remote-testgit.sh @@ -15,6 +15,8 @@ test -z $refspec prefix=refs export GIT_DIR=$url/.git +force= + mkdir -p $dir if test -z $GIT_REMOTE_TESTGIT_NO_MARKS Looking good, modulo a few minor nits I noticed while comparing with the one that has been queued in 'pu', which I commented separately. Will re-queue. Thanks. -- 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 v6 00/10] transport-helper: updates
On Mon, Nov 11, 2013 at 5:33 PM, Junio C Hamano gits...@pobox.com wrote: Felipe Contreras felipe.contre...@gmail.com writes: Here are the patches that allow transport helpers to be completely transparent; renaming branches, deleting them, custom refspecs, --force, --dry-run, reporting forced update, everything works. How are you sending your patches? % git-send-email --no-annotate list-of-patches However, I just noticed that the list-of-patches is in the wrong order. -- Felipe Contreras -- 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 v6 03/10] transport-helper: add 'force' to 'export' helpers
On Mon, Nov 11, 2013 at 5:28 PM, Junio C Hamano gits...@pobox.com wrote: Felipe Contreras felipe.contre...@gmail.com writes: Otherwise they cannot know when to force the push or not (other than hacks). Tests-by: Richard Hansen rhan...@bbn.com Documentation-by: Richard Hansen rhan...@bbn.com Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Didn't we agree that this should be warn, not die? Yes, and I assumed you would do it without a reroll, because no reroll was needed. I've updated my side as well now, for the next reroll. -- Felipe Contreras -- 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 v6 06/10] fast-export: add new --refspec option
On Mon, Nov 11, 2013 at 5:25 PM, Junio C Hamano gits...@pobox.com wrote: Felipe Contreras felipe.contre...@gmail.com writes: So that we can convert the exported ref names. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- I thought that the discussion agreed this option should not be called --refspec but something like --refmap? I don't know what you agreed to, but I didn't agree to anything. What you pass to this option is a refspec, so it makes sense to name the option --refspec. -- Felipe Contreras -- 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/3] for-each-ref: introduce %C(...) for color
Junio C Hamano gits...@pobox.com wrote: $ git show -s --format='%CredAnd%CyellowAreNotTheSameColor' Ouch, this is quite a disaster. It would have been much saner if we started from %(color:yellow), %(subject), etc., i.e. have a single long-hand magic introducer %(...), and added a set of often-used short-hands like %s. I am not opposed to unify the internal implementations and the external interfaces of pretty, for-each-ref and friends, but modelling the external UI after the mnemonic only with ad hoc additions mess the pretty-format uses is a huge mistake. Okay, I'm convinced; I'll rework the series to do %(color:...) and resubmit shortly. Thanks. -- 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 5/7] test-hg.sh: avoid obsolete 'test' syntax
On 2013-11-11 06:44, Felipe Contreras wrote: Richard Hansen wrote: The POSIX spec says that the '-a', '-o', and parentheses operands to the 'test' utility are obsolete extensions due to the potential for ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. All right, if you say so. In case you're curious about what the spec says: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 -Richard -- 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 v2 3/9] test-bzr.sh, test-hg.sh: allow running from any dir
Set TEST_DIRECTORY to the t/ directory (if TEST_DIRECTORY is not already set) so that the user doesn't already have to be in the test directory to run these test scripts. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-bzr.sh | 3 ++- contrib/remote-helpers/test-hg.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 5c50251..1e850c3 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -5,7 +5,8 @@ test_description='Test remote-bzr' -. ./test-lib.sh +test -n $TEST_DIRECTORY || TEST_DIRECTORY=${0%/*}/../../t +. $TEST_DIRECTORY/test-lib.sh if ! test_have_prereq PYTHON then diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 72f745d..fa7d17b 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -8,7 +8,8 @@ test_description='Test remote-hg' -. ./test-lib.sh +test -n $TEST_DIRECTORY || TEST_DIRECTORY=${0%/*}/../../t +. $TEST_DIRECTORY/test-lib.sh if ! test_have_prereq PYTHON then -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 1/9] remote-hg: don't decode UTF-8 paths into Unicode objects
The internal mercurial API expects ordinary 8-bit string objects, not Unicode string objects. With this change, the test-hg.sh unit tests pass again. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/git-remote-hg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 3222afd..c6026b9 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -747,7 +747,7 @@ def parse_commit(parser): f = { 'deleted' : True } else: die('Unknown file command: %s' % line) -path = c_style_unescape(path).decode('utf-8') +path = c_style_unescape(path) files[path] = f # only export the commits if we are on an internal proxy repo -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 6/9] test-hg.sh: avoid obsolete 'test' syntax
The POSIX spec says that the '-a', '-o', and parentheses operands to the 'test' utility are obsolete extensions due to the potential for ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index ceef6b1..5535e8c 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -83,7 +83,7 @@ check_push () { test $ref_ret -ne 0 echo match for '$branch' failed break done - if test $expected_ret -ne $ret -o $ref_ret -ne 0 + if test $expected_ret -ne $ret || test $ref_ret -ne 0 then return 1 fi -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 8/9] test-hg.sh: help user correlate verbose output with email test
It's hard to tell which author conversion test failed when the email addresses look similar. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index eb72db8..642ad93 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -206,16 +206,16 @@ test_expect_success 'authors' ' ../expected author_test alpha H G Wells we...@example.com - author_test beta test test unknown - author_test gamma test t...@example.com (comment) test t...@example.com - author_test delta t...@example.com Unknown t...@example.com - author_test epsilon namet...@example.com name t...@example.com - author_test zeta name t...@example.com name t...@example.com - author_test eta test test unknown - author_test theta test t...@example.com test t...@example.com - author_test iota test t...@example.com test t...@example.com - author_test kappa test test at example dot com test unknown - author_test lambda t...@example.com Unknown t...@example.com + author_test beta beta beta unknown + author_test gamma gamma t...@example.com (comment) gamma t...@example.com + author_test delta de...@example.com Unknown de...@example.com + author_test epsilon epsilont...@example.com epsilon t...@example.com + author_test zeta zeta t...@example.com zeta t...@example.com + author_test eta eta eta unknown + author_test theta theta t...@example.com theta t...@example.com + author_test iota iota t...@example.com iota t...@example.com + author_test kappa kappa test at example dot com kappa unknown + author_test lambda lam...@example.com Unknown lam...@example.com ) git clone hg::hgrepo gitrepo -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 2/9] test-lib.sh: convert $TEST_DIRECTORY to an absolute path
If $TEST_DIRECTORY is specified in the environment, convert the value to an absolute path to ensure that it remains valid even when 'cd' is used. Signed-off-by: Richard Hansen rhan...@bbn.com --- t/test-lib.sh | 4 1 file changed, 4 insertions(+) diff --git a/t/test-lib.sh b/t/test-lib.sh index b25249e..af172d9 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -26,6 +26,10 @@ then # outside of t/, e.g. for running tests on the test library # itself. TEST_DIRECTORY=$(pwd) +else + # ensure that TEST_DIRECTORY is an absolute path so that it + # works even if the current working directory is changed + TEST_DIRECTORY=$(cd $TEST_DIRECTORY pwd) || exit 1 fi if test -z $TEST_OUTPUT_DIRECTORY then -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 5/9] test-hg.sh: eliminate 'local' bashism
Unlike bash, POSIX shell does not specify a 'local' command for declaring function-local variable scope. Except for IFS, the variable names are not used anywhere else in the script so simply remove the 'local'. For IFS, move the assignment to the 'read' command to prevent it from affecting code outside the function. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index fa7d17b..ceef6b1 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -54,14 +54,14 @@ check_bookmark () { } check_push () { - local expected_ret=$1 ret=0 ref_ret=0 IFS=':' + expected_ret=$1 ret=0 ref_ret=0 shift git push origin $@ 2error ret=$? cat error - while read branch kind + while IFS=':' read branch kind do case $kind in 'new') -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 0/9] remote-hg, remote-bzr fixes
A handful of fixes for the git-remote-hg and git-remote-bzr remote helpers and their unit tests. Changes from v1: diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index ea597b0..1e53ff9 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -5,8 +5,8 @@ test_description='Test remote-bzr' -cd ${0%/*}/../../t || exit 1 -. ./test-lib.sh +test -n $TEST_DIRECTORY || TEST_DIRECTORY=${0%/*}/../../t +. $TEST_DIRECTORY/test-lib.sh if ! test_have_prereq PYTHON then @@ -28,9 +28,6 @@ check () { bzr whoami A U Thor aut...@example.com -# silence warnings -git config --global push.default simple - test_expect_success 'cloning' ' ( bzr init bzrrepo @@ -382,7 +379,7 @@ test_expect_success 'export utf-8 authors' ' git add content git commit -m one git remote add bzr bzr::../bzrrepo - git push -u bzr master + git push bzr master ) ( diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 9f5066b..347e812 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -8,8 +8,8 @@ test_description='Test remote-hg' -cd ${0%/*}/../../t || exit 1 -. ./test-lib.sh +test -n $TEST_DIRECTORY || TEST_DIRECTORY=${0%/*}/../../t +. $TEST_DIRECTORY/test-lib.sh if ! test_have_prereq PYTHON then @@ -102,9 +102,6 @@ setup () { GIT_AUTHOR_DATE=2007-01-01 00:00:00 +0230 GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE export GIT_COMMITTER_DATE GIT_AUTHOR_DATE - - # silence warnings - git config --global push.default simple } setup @@ -210,16 +207,16 @@ test_expect_success 'authors' ' ../expected author_test alpha H G Wells we...@example.com author_test beta beta beta unknown - author_test beta beta t...@example.com (comment) beta t...@example.com - author_test gamma ga...@example.com Unknown ga...@example.com - author_test delta deltat...@example.com delta t...@example.com - author_test epsilon epsilon t...@example.com epsilon t...@example.com - author_test zeta zeta zeta unknown - author_test eta eta t...@example.com eta t...@example.com - author_test theta theta t...@example.com theta t...@example.com - author_test iota iota test at example dot com iota unknown - author_test kappa ka...@example.com Unknown ka...@example.com - author_test lambda lambda.lam...@example.com Unknown lambda.lam...@example.com + author_test gamma gamma t...@example.com (comment) gamma t...@example.com + author_test delta de...@example.com Unknown de...@example.com + author_test epsilon epsilont...@example.com epsilon t...@example.com + author_test zeta zeta t...@example.com zeta t...@example.com + author_test eta eta eta unknown + author_test theta theta t...@example.com theta t...@example.com + author_test iota iota t...@example.com iota t...@example.com + author_test kappa kappa test at example dot com kappa unknown + author_test lambda lam...@example.com Unknown lam...@example.com + author_test mu mu...@example.com Unknown mu...@example.com ) git clone hg::hgrepo gitrepo diff --git a/t/test-lib.sh b/t/test-lib.sh index b25249e..af172d9 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -26,6 +26,10 @@ then # outside of t/, e.g. for running tests on the test library # itself. TEST_DIRECTORY=$(pwd) +else + # ensure that TEST_DIRECTORY is an absolute path so that it + # works even if the current working directory is changed + TEST_DIRECTORY=$(cd $TEST_DIRECTORY pwd) || exit 1 fi if test -z $TEST_OUTPUT_DIRECTORY then Richard Hansen (9): remote-hg: don't decode UTF-8 paths into Unicode objects test-lib.sh: convert $TEST_DIRECTORY to an absolute path test-bzr.sh, test-hg.sh: allow running from any dir test-bzr.sh, test-hg.sh: prepare for change to push.default=simple test-hg.sh: eliminate 'local' bashism test-hg.sh: avoid obsolete 'test' syntax test-hg.sh: fix duplicate content strings in author tests test-hg.sh: help user correlate verbose output with email test remote-bzr, remote-hg: fix email address regular expression contrib/remote-helpers/git-remote-bzr | 7 +++ contrib/remote-helpers/git-remote-hg | 9 - contrib/remote-helpers/test-bzr.sh| 5 +++-- contrib/remote-helpers/test-hg.sh | 30 -- t/test-lib.sh | 4 5 files changed, 30 insertions(+), 25 deletions(-) -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 7/9] test-hg.sh: fix duplicate content strings in author tests
beta was used twice. Change the second copy to gamma and increment the remaining content strings. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-hg.sh | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 5535e8c..eb72db8 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -207,15 +207,15 @@ test_expect_success 'authors' ' ../expected author_test alpha H G Wells we...@example.com author_test beta test test unknown - author_test beta test t...@example.com (comment) test t...@example.com - author_test gamma t...@example.com Unknown t...@example.com - author_test delta namet...@example.com name t...@example.com - author_test epsilon name t...@example.com name t...@example.com - author_test zeta test test unknown - author_test eta test t...@example.com test t...@example.com - author_test theta test t...@example.com test t...@example.com - author_test iota test test at example dot com test unknown - author_test kappa t...@example.com Unknown t...@example.com + author_test gamma test t...@example.com (comment) test t...@example.com + author_test delta t...@example.com Unknown t...@example.com + author_test epsilon namet...@example.com name t...@example.com + author_test zeta name t...@example.com name t...@example.com + author_test eta test test unknown + author_test theta test t...@example.com test t...@example.com + author_test iota test t...@example.com test t...@example.com + author_test kappa test test at example dot com test unknown + author_test lambda t...@example.com Unknown t...@example.com ) git clone hg::hgrepo gitrepo -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 4/9] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
Change 'git push remote' to 'git push remote branch' in one of the test-bzr.sh tests to ensure that the test continues to pass when the default value of push.default changes to simple. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/test-bzr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 1e850c3..1e53ff9 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -379,7 +379,7 @@ test_expect_success 'export utf-8 authors' ' git add content git commit -m one git remote add bzr bzr::../bzrrepo - git push bzr + git push bzr master ) ( -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 9/9] remote-bzr, remote-hg: fix email address regular expression
Before, strings like foo@example.com would be converted to foo. b...@example.com when they should be unknown foo@example.com. Signed-off-by: Richard Hansen rhan...@bbn.com --- contrib/remote-helpers/git-remote-bzr | 7 +++ contrib/remote-helpers/git-remote-hg | 7 +++ contrib/remote-helpers/test-hg.sh | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 054161a..7e34532 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -44,8 +44,8 @@ import StringIO import atexit, shutil, hashlib, urlparse, subprocess NAME_RE = re.compile('^([^]+)') -AUTHOR_RE = re.compile('^([^]+?)? ?([^]*)$') -EMAIL_RE = re.compile('^([^]+[^ \\\t])?\\b(?:[ \\t]*?)\\b([^ \\t]+@[^ \\t]+)') +AUTHOR_RE = re.compile('^([^]+?)? ?[]([^]*)(?:$|)') +EMAIL_RE = re.compile(r'([^ \t]+@[^ \t]+)') RAW_AUTHOR_RE = re.compile('^(\w+) (.+)? (.*) (\d+) ([+-]\d+)') def die(msg, *args): @@ -193,8 +193,7 @@ def fixup_user(user): else: m = EMAIL_RE.match(user) if m: -name = m.group(1) -mail = m.group(2) +mail = m.group(1) else: m = NAME_RE.match(user) if m: diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index c6026b9..30402d5 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -51,8 +51,8 @@ import time as ptime # NAME_RE = re.compile('^([^]+)') -AUTHOR_RE = re.compile('^([^]+?)? ?([^]*)$') -EMAIL_RE = re.compile('^([^]+[^ \\\t])?\\b(?:[ \\t]*?)\\b([^ \\t]+@[^ \\t]+)') +AUTHOR_RE = re.compile('^([^]+?)? ?[]([^]*)(?:$|)') +EMAIL_RE = re.compile(r'([^ \t]+@[^ \t]+)') AUTHOR_HG_RE = re.compile('^(.*?) ?(.*?)(?:(.+)?)?$') RAW_AUTHOR_RE = re.compile('^(\w+) (?:(.+)? )?(.*) (\d+) ([+-]\d+)') @@ -316,8 +316,7 @@ def fixup_user_git(user): else: m = EMAIL_RE.match(user) if m: -name = m.group(1) -mail = m.group(2) +mail = m.group(1) else: m = NAME_RE.match(user) if m: diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 642ad93..347e812 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -215,7 +215,8 @@ test_expect_success 'authors' ' author_test theta theta t...@example.com theta t...@example.com author_test iota iota t...@example.com iota t...@example.com author_test kappa kappa test at example dot com kappa unknown - author_test lambda lam...@example.com Unknown lam...@example.com + author_test lambda lam...@example.com Unknown lam...@example.com + author_test mu mu...@example.com Unknown mu...@example.com ) git clone hg::hgrepo gitrepo -- 1.8.5.rc1.208.g8ff7964 -- 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 v2 2/9] test-lib.sh: convert $TEST_DIRECTORY to an absolute path
On 2013-11-12 00:54, Richard Hansen wrote: If $TEST_DIRECTORY is specified in the environment, convert the value to an absolute path to ensure that it remains valid even when 'cd' is used. Signed-off-by: Richard Hansen rhan...@bbn.com Actually, credit for this and the next patch should go to Felipe. How should I note that? Thanks, Richard --- t/test-lib.sh | 4 1 file changed, 4 insertions(+) diff --git a/t/test-lib.sh b/t/test-lib.sh index b25249e..af172d9 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -26,6 +26,10 @@ then # outside of t/, e.g. for running tests on the test library # itself. TEST_DIRECTORY=$(pwd) +else + # ensure that TEST_DIRECTORY is an absolute path so that it + # works even if the current working directory is changed + TEST_DIRECTORY=$(cd $TEST_DIRECTORY pwd) || exit 1 fi if test -z $TEST_OUTPUT_DIRECTORY then -- 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 12/10] git-remote-testgit: support the new 'force' option
On 2013-11-11 13:28, Junio C Hamano wrote: Richard Hansen rhan...@bbn.com writes: I think the convention is to align these: case $opt in force) The existing case statement in this file indents the patterns the same amount as the case statement, so this should be aligned to match. In general I rarely see the case patterns indented at the same level as the case statement, What you see does not matter in the context of this project ;-) This is what we have in Documentation/CodingGuidelines: For shell scripts specifically (not exhaustive): - Case arms are indented at the same depth as case and esac lines. Doh! I missed that. Thanks for pointing it out. Thanks, Richard -- 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 00/86] replace prefixcmp() with has_prefix()
On Sat, Nov 9, 2013 at 3:24 PM, Thomas Rast t...@thomasrast.ch wrote: Christian Couder chrisc...@tuxfamily.org writes: Christian Couder (86): strbuf: add has_prefix() to be used instead of prefixcmp() diff: replace prefixcmd() with has_prefix() fast-import: replace prefixcmd() with has_prefix() [...] builtin/update-ref: replace prefixcmd() with has_prefix() builtin/upload-archive: replace prefixcmd() with has_prefix() strbuf: remove prefixcmp() as it has been replaced with has_prefix() All of your subjects except for the first and last say prefixcm*d*. :-) Yeah, sorry about that. Junio already sent me, with some others in cc, an email about this and I replied to all asking Junio if he wants me to resend with a fixed subject, but unfortunately the mailing list was not among the recipient of his email and my reply. Thanks and sorry again, 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 v6 00/10] transport-helper: updates
On 2013-11-11 17:54, Felipe Contreras wrote: Hi, Here are the patches that allow transport helpers to be completely transparent; renaming branches, deleting them, custom refspecs, --force, --dry-run, reporting forced update, everything works. Small changes since v5: diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 8ed41b4..4b76222 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -736,9 +736,10 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) usage_with_options (fast_export_usage, options); if (refspecs_list.nr) { - const char *refspecs_str[refspecs_list.nr]; + const char **refspecs_str; int i; + refspecs_str = xmalloc(sizeof(*refspecs_str) * refspecs_list.nr); for (i = 0; i refspecs_list.nr; i++) refspecs_str[i] = refspecs_list.items[i].string; @@ -746,6 +747,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) refspecs = parse_fetch_refspec(refspecs_nr, refspecs_str); string_list_clear(refspecs_list, 1); + free(refspecs_str); } if (use_done_feature) diff --git a/git-remote-testgit.sh b/git-remote-testgit.sh index 716aa4c..1c006a0 100755 --- a/git-remote-testgit.sh +++ b/git-remote-testgit.sh @@ -15,6 +15,8 @@ test -z $refspec prefix=refs export GIT_DIR=$url/.git +force= + mkdir -p $dir if test -z $GIT_REMOTE_TESTGIT_NO_MARKS What about changing those two test-hg.sh tests to test_expect_success? http://article.gmane.org/gmane.comp.version-control.git/237606 Should those changes be squashed into the transport-helper: don't update refs in dry-run and transport-helper: add 'force' to 'export' helpers commits? Or are those commits not really the appropriate place? Thanks, Richard -- 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 v2] remote-bzr: support the new 'force' option
Signed-off-by: Richard Hansen rhan...@bbn.com --- This is a reroll of: http://article.gmane.org/gmane.comp.version-control.git/237607 based on feedback from Felipe: http://article.gmane.org/gmane.comp.version-control.git/237615 This patch is an optional extension to Felipe's transport-helper: updates patch series: http://thread.gmane.org/gmane.comp.version-control.git/237663 and it requires those changes to work. contrib/remote-helpers/git-remote-bzr | 32 +++- contrib/remote-helpers/test-bzr.sh| 22 +- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 7e34532..2f481e9 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -42,6 +42,7 @@ import json import re import StringIO import atexit, shutil, hashlib, urlparse, subprocess +import types NAME_RE = re.compile('^([^]+)') AUTHOR_RE = re.compile('^([^]+?)? ?[]([^]*)(?:$|)') @@ -684,7 +685,8 @@ def do_export(parser): peer = bzrlib.branch.Branch.open(peers[name], possible_transports=transports) try: -peer.bzrdir.push_branch(branch, revision_id=revid) +peer.bzrdir.push_branch(branch, revision_id=revid, +overwrite=force) except bzrlib.errors.DivergedBranches: print error %s non-fast forward % ref continue @@ -718,8 +720,32 @@ def do_capabilities(parser): print *import-marks %s % path print *export-marks %s % path +print option print +class InvalidOptionValue(Exception): +pass + +def get_bool_option(val): +if val == 'true': +return True +elif val == 'false': +return False +else: +raise InvalidOptionValue() + +def do_option(parser): +global force +(opt, val) = parser[1:3] +try: +if opt == 'force': +force = get_bool_option(val) +print 'ok' +else: +print 'unsupported' +except InvalidOptionValue: +print error '%s' is not a valid value for option '%s' % (val, opt) + def ref_is_valid(name): return not True in [c in name for c in '~^: \\'] @@ -882,6 +908,7 @@ def main(args): global is_tmp global branches, peers global transports +global force alias = args[1] url = args[2] @@ -895,6 +922,7 @@ def main(args): branches = {} peers = {} transports = [] +force = False if alias[5:] == url: is_tmp = True @@ -930,6 +958,8 @@ def main(args): do_import(parser) elif parser.check('export'): do_export(parser) +elif parser.check('option'): +do_option(parser) else: die('unhandled command: %s' % line) sys.stdout.flush() diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 1e53ff9..4f379c2 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -66,13 +66,33 @@ test_expect_success 'pushing' ' test_cmp expected actual ' +test_expect_success 'forced pushing' ' + ( + cd gitrepo + echo three-new content + git commit -a --amend -m three-new + git push -f + ) + + ( + cd bzrrepo + # the forced update overwrites the bzr branch but not the bzr + # working directory (it tries to merge instead) + bzr revert + ) + + echo three-new expected + cat bzrrepo/content actual + test_cmp expected actual +' + test_expect_success 'roundtrip' ' ( cd gitrepo git pull git log --format=%s -1 origin/master actual ) - echo three expected + echo three-new expected test_cmp expected actual (cd gitrepo git push git pull) -- 1.8.5.rc1.208.g8ff7964 -- 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 PULL] l10n updates for 1.8.5 round 1
Hi, Junio Please pull l10n updates for Git 1.8.5 round 1. The following changes since commit aa2706463fdeb51d6f9d0e267113b251888cf7f5: Update draft release notes to 1.8.5 (2013-11-01 08:14:52 -0700) are available in the git repository at: git://github.com/git-l10n/git-po master for you to fetch changes up to 1f6fb7ffc344e59589ac794ce7ae47ae7c2cff42: l10n: de.po: improve error message when pushing to unknown upstream (2013-11-12 06:31:15 +0100) Jean-Noel Avila (1): l10n: fr.po 2194/1294 messages translated Jiang Xin (3): l10n: git.pot: v1.8.5 round 1 (68 new, 9 removed) l10n: zh_CN.po: translate 68 messages (2194t0f0u) Merge remote-tracking branch 'sv/nafmo/master' Peter Krefting (1): l10n: Update Swedish translation (2194t0f0u) Ralf Thielow (3): po/TEAMS: update Thomas Rast's email address l10n: de.po: translate 68 new messages l10n: de.po: improve error message when pushing to unknown upstream Tran Ngoc Quan (1): l10n: vi.po (2194t): Update and minor fix po/TEAMS|2 +- po/de.po| 2716 +++- po/fr.po| 2743 +++-- po/git.pot | 2664 ++- po/sv.po| 2716 +++- po/vi.po| 2838 --- po/zh_CN.po | 2778 +++-- 7 files changed, 9045 insertions(+), 7412 deletions(-) -- 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 v6 06/10] fast-export: add new --refspec option
On 2013-11-11 18:50, Felipe Contreras wrote: On Mon, Nov 11, 2013 at 5:25 PM, Junio C Hamano gits...@pobox.com wrote: Felipe Contreras felipe.contre...@gmail.com writes: So that we can convert the exported ref names. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- I thought that the discussion agreed this option should not be called --refspec but something like --refmap? I don't know what you agreed to, http://article.gmane.org/gmane.comp.version-control.git/237473 but I didn't agree to anything. Based on your silence I too thought that you had agreed. What you pass to this option is a refspec, so it makes sense to name the option --refspec. As discussed in that thread, it's not really the same thing as a refspec used in push or fetch. In those commands, the refspec specifies two separable things: what to transfer, and how to translate refs names between the remote and local repositories. IIUC, the fast-export --refspec argument only specifies how to translate ref names, not what gets transferred. If my understanding is correct, then I agree with Junio and Peff that --refmap is a better name. -Richard -- 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? diff.submodule=log adds text to commit -v message
Am 11.11.2013 22:29, schrieb Jens Lehmann: The diff below fixes the problem you describe for me. (But I do not consider it a worthwhile fix in its current form because a line starting with Submodule might appear in a perfectly normal commit message, while diff --git most probably won't). And on top of that, Submodule originates from a translatable string, doesn't it? -- 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