Re: git checkout problem
"J.V." writes: > Now am trying to go back to my master branch and get: > > error: The following untracked working tree files would be overwritten by > checkout: > lib/derbyclient.jar > Please move or remove them before you can switch branches. > Aborting When in doubt, try running "git status". What does it say? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." -- 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] add: allow users to silence Git 2.0 warnings about "add -u"
David Aguilar writes: > I was originally concerned that "git add -u" was going to die() > and we would no longer be able to use it without pathspec. > My concerns were unfounded. > > (If I am not understanding this correctly then it is a sign > that the draft release notes can be made more clear) Yes, that is exactly why I asked you to suggest improvements to that paragraph. >> Another problem with use2dot0 configuration is that it would invite >> people to imagine that setting it to false will keep the old >> behaviour forever, which is against what you set out to do with the >> patch under discussion. > > I agree with both sides. There's the part of me that wants the 2.0 > behavior now with a config switch for the same reasons as was > discussed earlier... If that is really the case and you want the full-tree behaviour, you would have been using "git add -u :/" already, and then you wouldn't have seen the warning. Why do we have this thread then? The reason may well be "I've heard about the :/ magic pathspec, and I thought I understood what it does at the intellectual level, but it has not sunk in enough for me to use it regularly". The warning, and "you can squelch with either :/ or ." to train the fingers (not "set once and forget"), is exactly to solve that problem now *and* *in* *the* *future* during the 2.0 transition period. You also said that it often is the case for you that you stay in a narrow subtree without touching other parts of the tree. If that is the case, you may *not* want 2.0 behaviour, which forces Git to run around the whole tree, trying to find modified paths outside of your corner that do not exist, wasting cycles. You want "git add .", and you are better off starting to train your fingers so that they type that without thinking now. I think the conclusion during the old discussion was not "we want configuration", but "this is not per user and configuration is a poor approach. Depending on what you are working on right now, you would want 'only here' sometimes and 'whole tree' some other times". > We would never want to go back to the old behavior when 2.0 > roll around. Jakub's "future.wholeTree" suggestion makes > sense in that context as the entire "future.*" namespace > could be designated as variables with these semantics. Not at all. Even you who visit this list often do not regularly use the ":/" to affect the whole tree and see the warning. What do you imagine other people, who do not even know about this list do and say, at sites like stackoverflow where uninformeds guide other uninformeds? Q. Help, Git 1.8.2 is giving me this warning. What to do? A. Set this configuration variable. No other explanation. Renaming use2dot0 to future does not solve anything. > OTOH a positive thing about adding configuration to get > the better behavior is that the code path materializes > sooner, and it will be better exercised before 2.0. That is not an argument for adding temporary configuration, as it is not the only or even the best way to do so. It can be easily an cleanly achieved by cooking in next until 2.0. An ulterior motive for going that way is to encourage more people to run 'next' ;-). Recently we are seeing bugs discovered only after topics graduate to 'master', which is not a good sign X-<. -- 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 v3] branch: segfault fixes and validation
branch_get() can return NULL (so far on detached HEAD only) but some code paths in builtin/branch.c cannot deal with that and cause segfaults. While at there, make sure to bail out when the user gives 2 or more branches with --set-upstream-to or --unset-upstream, where only the first branch is processed and the rest silently dropped. Reported-by: Per Cederqvist Signed-off-by: Nguyễn Thái Ngọc Duy --- On Sat, Feb 23, 2013 at 3:27 AM, Junio C Hamano wrote: > Instead of asking "Is it detached?", perhaps we can say something > like "You told me to set the upstream of HEAD to branch X, but " in > front? At least, that will be a better explanation for the reason > why the operation is failing. Fixed. > What you can do is to have a single helper function that can explain > why branch_get() returned NULL (or extend branch_get() to serve that > purpose as well); then you do not have to duplicate the logic twice > on the caller's side (and there may be other callers that want to do > the same). The explanation mentions about the failed operation, which makes a helper less useful. We could still do the helper, but it may lead to i18n legos. So no helper in this version. > The existing test might be wrong, by the way. Your HEAD may point > at a branch Y but you may not have any commit on it yet, and you may > want to allow setting the upstream of that to-be-born branch to > another branch X with "branch --set-upstream-to=X [Y|HEAD]". It sounds complicated. I think we can revisit it when a user actually complains about it. builtin/branch.c | 27 +++ t/t3200-branch.sh | 21 + 2 files changed, 48 insertions(+) diff --git a/builtin/branch.c b/builtin/branch.c index 6371bf9..00d17d2 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -889,6 +889,17 @@ int cmd_branch(int argc, const char **argv, const char *prefix) } else if (new_upstream) { struct branch *branch = branch_get(argv[0]); + if (argc > 1) + die(_("too many branches to set new upstream")); + + if (!branch) { + if (!argc || !strcmp(argv[0], "HEAD")) + die(_("could not set upstream of HEAD to %s when " + "it does not point to any branch."), + new_upstream); + die(_("no such branch '%s'"), argv[0]); + } + if (!ref_exists(branch->refname)) die(_("branch '%s' does not exist"), branch->name); @@ -901,6 +912,16 @@ int cmd_branch(int argc, const char **argv, const char *prefix) struct branch *branch = branch_get(argv[0]); struct strbuf buf = STRBUF_INIT; + if (argc > 1) + die(_("too many branches to unset upstream")); + + if (!branch) { + if (!argc || !strcmp(argv[0], "HEAD")) + die(_("could not unset upstream of HEAD when " + "it does not point to any branch.")); + die(_("no such branch '%s'"), argv[0]); + } + if (!branch_has_merge_config(branch)) { die(_("Branch '%s' has no upstream information"), branch->name); } @@ -916,6 +937,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix) int branch_existed = 0, remote_tracking = 0; struct strbuf buf = STRBUF_INIT; + if (!strcmp(argv[0], "HEAD")) + die(_("it does not make sense to create 'HEAD' manually")); + + if (!branch) + die(_("no such branch '%s'"), argv[0]); + if (kinds != REF_LOCAL_BRANCH) die(_("-a and -r options to 'git branch' do not make sense with a branch name")); diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index f3e0e4a..12f1e4a 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -42,6 +42,10 @@ test_expect_success \ 'git branch a/b/c should create a branch' \ 'git branch a/b/c && test_path_is_file .git/refs/heads/a/b/c' +test_expect_success \ +'git branch HEAD should fail' \ +'test_must_fail git branch HEAD' + cat >expect < 1117150200 + branch: Created from master EOF @@ -388,6 +392,14 @@ test_expect_success \ 'git tag foobar && test_must_fail git branch --track my11 foobar' +test_expect_success '--set-upstream-to fails on multiple branches' \ +'test_must_fail git branch --set-upstream-to master a b c' + +test_expect_success '--set-upstream-to fails on detached HEAD' \ +'git checkout HEAD^{} && + test_must_fail git branch --set-upstream-to master && + git checkout -' + test_expect_success 'use --set-upstream-to modify HEAD' \ 'test_config branch.mas
Fwd: Compiling git 1.8.1.4 on 64bit centos 5.6
g'day, got a web host where I want to put git - it has no c compiler, so I have to compile elsewhere.ssh is also locked out, so I have to use https. The site uses both 64bit and 32bit hosts. On a 32bit vm, I compiled the 32bit version of git fine with -static, sent the binaries over, and it works perfectly. On a 64bit vm, I just cannot get a 64 bit version of git compiling with -static... or more precisely - I can but can't whatever I have tried get a remote-http and remote-https to turn up in libexec. Even when I hack the configure to force NO_CURL= and NO_OPENSSL= - and add every extra library I seem to need (-lcrypto, -lssl -lkrb5 -ldl) it refuses to compile - giving me a bunch of missing krb5_* If I compile without static, it works - but the shared libraries aren't found when it's run from the web host. If I try running the 32bit version on the 64bit host, it doesn't find some library - and if I try the 64bit version that I can properly get compiling statically, I get an error saying no remote found for https. Please help - it's driving me insane... can anyone tell me how to compile a 64 bit static version of git under centos 5.6? Thanks, Darren -- 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] Spelling fixes.
Signed-off-by: Ville Skyttä --- Documentation/RelNotes/1.7.5.4.txt | 2 +- Documentation/RelNotes/1.7.8.txt | 2 +- Documentation/RelNotes/1.8.2.txt | 2 +- Documentation/git-credential.txt | 2 +- Documentation/git-remote-ext.txt | 2 +- Documentation/git-svn.txt | 4 ++-- Documentation/revisions.txt| 2 +- Documentation/technical/api-argv-array.txt | 2 +- Documentation/technical/api-credentials.txt| 2 +- Documentation/technical/api-ref-iteration.txt | 2 +- builtin/apply.c| 6 +++--- commit.c | 2 +- commit.h | 2 +- contrib/mw-to-git/git-remote-mediawiki.perl| 6 +++--- contrib/mw-to-git/t/README | 6 +++--- contrib/mw-to-git/t/install-wiki/LocalSettings.php | 2 +- contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh| 10 +- contrib/mw-to-git/t/test-gitmw-lib.sh | 2 +- contrib/subtree/t/t7900-subtree.sh | 2 +- diff.c | 2 +- git-add--interactive.perl | 2 +- git-cvsserver.perl | 4 ++-- git-gui/lib/blame.tcl | 2 +- git-gui/lib/index.tcl | 2 +- git-gui/lib/spellcheck.tcl | 4 ++-- git-quiltimport.sh | 2 +- gitweb/INSTALL | 2 +- gitweb/gitweb.perl | 6 +++--- kwset.c| 4 ++-- perl/Git.pm| 2 +- perl/Git/I18N.pm | 2 +- perl/private-Error.pm | 2 +- po/README | 6 +++--- po/pt_PT.po| 2 +- po/zh_CN.po| 2 +- sequencer.c| 2 +- t/t0022-crlf-rename.sh | 2 +- t/t3701-add-interactive.sh | 2 +- t/t4014-format-patch.sh| 6 +++--- t/t4124-apply-ws-rule.sh | 2 +- t/t6030-bisect-porcelain.sh| 2 +- t/t7001-mv.sh | 8 t/t7004-tag.sh | 2 +- t/t7600-merge.sh | 2 +- t/t7601-merge-pull-config.sh | 2 +- t/t9001-send-email.sh | 2 +- transport.h| 2 +- xdiff/xdiffi.c | 2 +- xdiff/xhistogram.c | 2 +- 49 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Documentation/RelNotes/1.7.5.4.txt b/Documentation/RelNotes/1.7.5.4.txt index cf3f455..7796df3 100644 --- a/Documentation/RelNotes/1.7.5.4.txt +++ b/Documentation/RelNotes/1.7.5.4.txt @@ -5,7 +5,7 @@ Fixes since v1.7.5.3 * The single-key mode of "git add -p" was easily fooled into thinking - that it was told to add everthing ('a') when up-arrow was pressed by + that it was told to add everything ('a') when up-arrow was pressed by mistake. * Setting a git command that uses custom configuration via "-c var=val" diff --git a/Documentation/RelNotes/1.7.8.txt b/Documentation/RelNotes/1.7.8.txt index b4d90bb..7012329 100644 --- a/Documentation/RelNotes/1.7.8.txt +++ b/Documentation/RelNotes/1.7.8.txt @@ -9,7 +9,7 @@ Updates since v1.7.7 * Updates to bash completion scripts. * The build procedure has been taught to take advantage of computed - dependency automatically when the complier supports it. + dependency automatically when the compiler supports it. * The date parser now accepts timezone designators that lack minutes part and also has a colon between "hh:mm". diff --git a/Documentation/RelNotes/1.8.2.txt b/Documentation/RelNotes/1.8.2.txt index a287f24..4e63644 100644 --- a/Documentation/RelNotes/1.8.2.txt +++ b/Documentation/RelNotes/1.8.2.txt @@ -17,7 +17,7 @@ preference configuration variable "push.default" to change this. "git push $there tag v1.2.3" used to allow replacing a tag v1.2.3 that already exists in the repository $there, if the rewritten tag -you are pushing points at a commit that is a decendant of a commit +you are pushing points at a commit that is a descendant of a commit that the old tag v1.2.3 points at. This was found to be error prone and starting with this release, any attempt to update an existing ref under refs/tags/ hierarchy will fail, without "--force". diff --git a/Documentation/git-cre
Re: Suggested improvements to the git-p4 documentation (branch-related)
gits...@pobox.com wrote on Fri, 22 Feb 2013 16:42 -0800: > Olivier Delalleau writes: > > > 2013/1/5 Pete Wyckoff : > >> sh...@keba.be wrote on Thu, 03 Jan 2013 15:58 -0500: > > ... > >> Please do feel welcome to to rearrange or expand the > >> documentation so it makes more sense, if you are so inspired. > > > > I'm afraid I'm not familiar enough with git documentation to dig into > > it myself, but anyway that's about what I had for now. I'll send more > > comments to the mailing list if I have more suggestions in the future. > > > > Thanks for a great tool! :) > > Did anything come out of this thread? If neither of you two are > inclined to conclude the discussion with a final patch, I'd > appreciate anybody else who does the honors ;-) > > We'll be in deep pre-release freeze for a few weeks, so there is no > need to rush. Two of Olivier's suggestions were best classified as code, not documentation, bugs. I finished off some ongoing work that fixed those along the way. The third led to a fix to the documentation, 182edef (git p4 doc: fix branch detection example, 2013-01-14), that I added as part of that series. All of it is in master now, via 801cbd7 (Merge branch 'pw/p4-branch-fixes', 2013-01-21). I should have commented on this thread too. Thanks for following up! -- Pete -- 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] Spelling fixes.
On Sat, Feb 23, 2013 at 9:31 PM, Ville Skyttä wrote: > 49 files changed, 72 insertions(+), 72 deletions(-) I know I make spelling mistakes on daily basis, but I did not know we made so many. Changes in the test suite and non-contrib *.[ch] look good. -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] Documentation/githooks: Explain pre-rebase parameters
From: "W. Trevor King" Descriptions borrowed from templates/hooks--pre-rebase.sample. Signed-off-by: W. Trevor King --- Changes from v1: * Replaced "empty" with "missing" for second parameter. Documentation/githooks.txt | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index b9003fe..dfd5959 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -140,9 +140,10 @@ the outcome of 'git commit'. pre-rebase ~~ -This hook is called by 'git rebase' and can be used to prevent a branch -from getting rebased. - +This hook is called by 'git rebase' and can be used to prevent a +branch from getting rebased. The hook takes two parameters: the +upstream the series was forked from and the branch being rebased. The +second parameter will be missing when rebasing the current branch. post-checkout ~ -- 1.8.2.rc0.16.g20a599e -- 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] Fwd: Compiling git 1.8.1.4 on 64bit centos 5.6
On Sun, Feb 24, 2013 at 12:13:11AM +1100, Darren Oakey wrote: > If I compile without static, it works - but the shared libraries > aren't found when it's run from the web host. If I try running the > 32bit version on the 64bit host, it doesn't find some library This is a shot in the dark, but are you sure you have static versions of the libraries in questions (*.a) installed? -- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy signature.asc Description: OpenPGP digital signature
[PATCH] diff: Fix rename pretty-print when suffix and prefix overlap
When considering a rename for two files that have a suffix and a prefix that can overlap, a confusing line is shown. As an example, renaming "a/b/b/c" to "a/b/c" shows "a/b/{ => }/b/c". Currently, what we do is calculate the common prefix ("a/b/"), and the common suffix ("/b/c"), but the same "/b/" is actually counted both in prefix and suffix. Then when calculating the size of the non-common part, we end-up with a negative value which is reset to 0, thus the "{ => }". Do not allow the common suffix to overlap the common prefix and stop when reaching a "/" that would be in both. Signed-off-by: Antoine Pelisse --- diff.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/diff.c b/diff.c index 156fec4..80f4752 100644 --- a/diff.c +++ b/diff.c @@ -1290,7 +1290,16 @@ static char *pprint_rename(const char *a, const char *b) old = a + len_a; new = b + len_b; sfx_length = 0; - while (a <= old && b <= new && *old == *new) { + /* +* Note: +* if pfx_length is 0, old/new will never reach a - 1 because it +* would mean the whole string is common suffix. But then, the +* whole string would also be a common prefix, and we would not +* have pfx_length equals 0. +*/ + while (a + pfx_length - 1 <= old && + b + pfx_length - 1 <= new && + *old == *new) { if (*old == '/') sfx_length = len_a - (old - a); old--; -- 1.7.9.5 -- 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] l10n: de.po: correct translation of "bisect" messages
The term "bisect" was translated as "halbieren", we should translate it as "binäre Suche" (binary search). While at there, we should leave "bisect run" untranslated since it's a subcommand of "git bisect". Suggested-by: Thomas Rast Signed-off-by: Ralf Thielow --- po/de.po | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/po/de.po b/po/de.po index c0e5398..58a1a46 100644 --- a/po/de.po +++ b/po/de.po @@ -1349,11 +1349,11 @@ msgstr " (alle Konflikte behoben: führen Sie \"git commit\" aus)" #: wt-status.c:958 #, c-format msgid "You are currently bisecting branch '%s'." -msgstr "Sie sind gerade beim Halbieren in Zweig '%s'." +msgstr "Sie sind gerade bei einer binären Suche in Zweig '%s'." #: wt-status.c:962 msgid "You are currently bisecting." -msgstr "Sie sind gerade beim Halbieren." +msgstr "Sie sind gerade bei einer binären Suche." #: wt-status.c:965 msgid " (use \"git bisect reset\" to get back to the original branch)" @@ -9247,7 +9247,7 @@ msgstr "" #: git-bisect.sh:140 msgid "won't bisect on seeked tree" -msgstr "\"bisect\" auf gesuchtem Zweig nicht möglich" +msgstr "binäre Suche auf gesuchtem Zweig nicht möglich" #: git-bisect.sh:144 msgid "Bad HEAD - strange symbolic ref" @@ -9280,7 +9280,7 @@ msgstr "'git bisect bad' kann nur ein Argument entgegennehmen." #. this is less optimum. #: git-bisect.sh:273 msgid "Warning: bisecting only with a bad commit." -msgstr "Warnung: halbiere nur mit einer fehlerhaften Version" +msgstr "Warnung: binäre Suche nur mit einer fehlerhaften Version" #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input @@ -9310,7 +9310,7 @@ msgstr "" #: git-bisect.sh:347 git-bisect.sh:474 msgid "We are not bisecting." -msgstr "Wir sind nicht beim Halbieren." +msgstr "keine binären Suche im Gange" #: git-bisect.sh:354 #, sh-format @@ -9350,12 +9350,12 @@ msgid "" "bisect run failed:\n" "exit code $res from '$command' is < 0 or >= 128" msgstr "" -"Ausführung der Halbierung fehlgeschlagen:\n" +"'bisect run' fehlgeschlagen:\n" "Rückkehrwert $res von '$command' ist < 0 oder >= 128" #: git-bisect.sh:453 msgid "bisect run cannot continue any more" -msgstr "Ausführung der Halbierung kann nicht mehr fortgesetzt werden" +msgstr "'bisect run' kann nicht mehr fortgesetzt werden" #: git-bisect.sh:459 #, sh-format @@ -9363,12 +9363,12 @@ msgid "" "bisect run failed:\n" "'bisect_state $state' exited with error code $res" msgstr "" -"Ausführung der Halbierung fehlgeschlagen:\n" +"'bisect run' fehlgeschlagen:\n" "'bisect_state $state' wurde mit Fehlerwert $res beendet" #: git-bisect.sh:466 msgid "bisect run success" -msgstr "Halbierung erfolgreich ausgeführt" +msgstr "'bisect run' erfolgreich ausgeführt" #: git-pull.sh:21 msgid "" -- 1.8.2.rc0.22.gb3600c3 -- 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] l10n: de.po: correct translation of "bisect" messages
Ralf Thielow writes: > diff --git a/po/de.po b/po/de.po > index c0e5398..58a1a46 100644 > --- a/po/de.po > +++ b/po/de.po > @@ -1349,11 +1349,11 @@ msgstr " (alle Konflikte behoben: führen Sie > \"git commit\" aus)" > #: wt-status.c:958 > #, c-format > msgid "You are currently bisecting branch '%s'." > -msgstr "Sie sind gerade beim Halbieren in Zweig '%s'." > +msgstr "Sie sind gerade bei einer binären Suche in Zweig '%s'." ^^^ "an"? Or is that again my Swiss non-German interfering? > #: wt-status.c:962 > msgid "You are currently bisecting." > -msgstr "Sie sind gerade beim Halbieren." > +msgstr "Sie sind gerade bei einer binären Suche." Same here. > #: git-bisect.sh:140 > msgid "won't bisect on seeked tree" > -msgstr "\"bisect\" auf gesuchtem Zweig nicht möglich" > +msgstr "binäre Suche auf gesuchtem Zweig nicht möglich" Does cogito actually have a German translation? The comment right above this message says it's only for cogito users. Then again cogito has been deprecated since 2006. Maybe the English message should instead be rewritten to say "stop using cg!". ;-) > #. TRANSLATORS: Make sure to include [Y] and [n] in your > #. translation. The program will only accept English input > @@ -9310,7 +9310,7 @@ msgstr "" > > #: git-bisect.sh:347 git-bisect.sh:474 > msgid "We are not bisecting." > -msgstr "Wir sind nicht beim Halbieren." > +msgstr "keine binären Suche im Gange" ^ s/n / / -- Thomas Rast trast@{inf,student}.ethz.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] update-index: allow "-h" to also display options
Currently, when running "git update-index -h", you only have usage displayed, but no options. That is not consistent with the behavior of other commands. It also means that the only way to display options is to use an unknown argument (or use the man page). Display usage with options when "git update-index -h" is invoked. Signed-off-by: Antoine Pelisse --- builtin/update-index.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index ada1dff..3071ee6 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) }; if (argc == 2 && !strcmp(argv[1], "-h")) - usage(update_index_usage[0]); + usage_with_options(&update_index_usage[0], options); git_config(git_default_config, NULL); -- 1.7.9.5 -- 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] update-index: allow "-h" to also display options
> diff --git a/builtin/update-index.c b/builtin/update-index.c > index ada1dff..3071ee6 100644 > --- a/builtin/update-index.c > +++ b/builtin/update-index.c > @@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const > char *prefix) > }; > > if (argc == 2 && !strcmp(argv[1], "-h")) > - usage(update_index_usage[0]); > + usage_with_options(&update_index_usage[0], options); > > git_config(git_default_config, NULL); > Ok I just realized that usage_with_options(update_index_usage, options); would be better... Antoine, -- 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] l10n: de.po: correct translation of "bisect" messages
2013/2/23 Thomas Rast : > Ralf Thielow writes: > >> diff --git a/po/de.po b/po/de.po >> index c0e5398..58a1a46 100644 >> --- a/po/de.po >> +++ b/po/de.po >> @@ -1349,11 +1349,11 @@ msgstr " (alle Konflikte behoben: führen Sie >> \"git commit\" aus)" >> #: wt-status.c:958 >> #, c-format >> msgid "You are currently bisecting branch '%s'." >> -msgstr "Sie sind gerade beim Halbieren in Zweig '%s'." >> +msgstr "Sie sind gerade bei einer binären Suche in Zweig '%s'." >^^^ > > "an"? Or is that again my Swiss non-German interfering? > I think "bei" is correct when a search is in progress. "bei einer Suche sein", "an einer Suche beteiligen" but not "an einer Suche sein", IMO Unfortunately, I haven't found a serious proof on the internet. There is a picture with a subheading on http://www.duden.de/rechtschreibung/Suche which says "...bei der Suche nach...", though. >> #: wt-status.c:962 >> msgid "You are currently bisecting." >> -msgstr "Sie sind gerade beim Halbieren." >> +msgstr "Sie sind gerade bei einer binären Suche." > > Same here. > >> #: git-bisect.sh:140 >> msgid "won't bisect on seeked tree" >> -msgstr "\"bisect\" auf gesuchtem Zweig nicht möglich" >> +msgstr "binäre Suche auf gesuchtem Zweig nicht möglich" > > Does cogito actually have a German translation? The comment right above > this message says it's only for cogito users. > > Then again cogito has been deprecated since 2006. Maybe the English > message should instead be rewritten to say "stop using cg!". ;-) > >> #. TRANSLATORS: Make sure to include [Y] and [n] in your >> #. translation. The program will only accept English input >> @@ -9310,7 +9310,7 @@ msgstr "" >> >> #: git-bisect.sh:347 git-bisect.sh:474 >> msgid "We are not bisecting." >> -msgstr "Wir sind nicht beim Halbieren." >> +msgstr "keine binären Suche im Gange" >^ > > s/n / / > Thanks. > -- > Thomas Rast > trast@{inf,student}.ethz.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
[PATCHv2] l10n: de.po: correct translation of "bisect" messages
The term "bisect" was translated as "halbieren", we should translate it as "binäre Suche" (binary search). While at there, we should leave "bisect run" untranslated since it's a subcommand of "git bisect". Suggested-by: Thomas Rast Signed-off-by: Ralf Thielow --- po/de.po | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/po/de.po b/po/de.po index c0e5398..4df53e4 100644 --- a/po/de.po +++ b/po/de.po @@ -1349,11 +1349,11 @@ msgstr " (alle Konflikte behoben: führen Sie \"git commit\" aus)" #: wt-status.c:958 #, c-format msgid "You are currently bisecting branch '%s'." -msgstr "Sie sind gerade beim Halbieren in Zweig '%s'." +msgstr "Sie sind gerade bei einer binären Suche in Zweig '%s'." #: wt-status.c:962 msgid "You are currently bisecting." -msgstr "Sie sind gerade beim Halbieren." +msgstr "Sie sind gerade bei einer binären Suche." #: wt-status.c:965 msgid " (use \"git bisect reset\" to get back to the original branch)" @@ -9247,7 +9247,7 @@ msgstr "" #: git-bisect.sh:140 msgid "won't bisect on seeked tree" -msgstr "\"bisect\" auf gesuchtem Zweig nicht möglich" +msgstr "binäre Suche auf gesuchtem Zweig nicht möglich" #: git-bisect.sh:144 msgid "Bad HEAD - strange symbolic ref" @@ -9280,7 +9280,7 @@ msgstr "'git bisect bad' kann nur ein Argument entgegennehmen." #. this is less optimum. #: git-bisect.sh:273 msgid "Warning: bisecting only with a bad commit." -msgstr "Warnung: halbiere nur mit einer fehlerhaften Version" +msgstr "Warnung: binäre Suche nur mit einer fehlerhaften Version" #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input @@ -9310,7 +9310,7 @@ msgstr "" #: git-bisect.sh:347 git-bisect.sh:474 msgid "We are not bisecting." -msgstr "Wir sind nicht beim Halbieren." +msgstr "keine binäre Suche im Gange" #: git-bisect.sh:354 #, sh-format @@ -9350,12 +9350,12 @@ msgid "" "bisect run failed:\n" "exit code $res from '$command' is < 0 or >= 128" msgstr "" -"Ausführung der Halbierung fehlgeschlagen:\n" +"'bisect run' fehlgeschlagen:\n" "Rückkehrwert $res von '$command' ist < 0 oder >= 128" #: git-bisect.sh:453 msgid "bisect run cannot continue any more" -msgstr "Ausführung der Halbierung kann nicht mehr fortgesetzt werden" +msgstr "'bisect run' kann nicht mehr fortgesetzt werden" #: git-bisect.sh:459 #, sh-format @@ -9363,12 +9363,12 @@ msgid "" "bisect run failed:\n" "'bisect_state $state' exited with error code $res" msgstr "" -"Ausführung der Halbierung fehlgeschlagen:\n" +"'bisect run' fehlgeschlagen:\n" "'bisect_state $state' wurde mit Fehlerwert $res beendet" #: git-bisect.sh:466 msgid "bisect run success" -msgstr "Halbierung erfolgreich ausgeführt" +msgstr "'bisect run' erfolgreich ausgeführt" #: git-pull.sh:21 msgid "" -- 1.8.2.rc0.22.gb3600c3 -- 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] Spelling fixes.
Am 23.02.2013 15:31, schrieb Ville Skyttä: Signed-off-by: Ville Skyttä --- Documentation/RelNotes/1.7.5.4.txt | 2 +- Documentation/RelNotes/1.7.8.txt | 2 +- Retroactively changing release notes for older versions is not worth it, I think. Documentation/RelNotes/1.8.2.txt | 2 +- Fixing typos in this draft for the next release is a good idea, though. kwset.c| 4 ++-- xdiff/xdiffi.c | 2 +- These files come from external sources and it would be nice to push fixes (not just for typos) upstream as well. René -- 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] pkt-line: Fix sparse errors and warnings
Sparse issues the following error and warnings: pkt-line.c:209:51: warning: Using plain integer as NULL pointer sideband.c:41:52: warning: Using plain integer as NULL pointer daemon.c:615:39: warning: Using plain integer as NULL pointer remote-curl.c:220:75: error: incompatible types for operation (>) remote-curl.c:220:75:left side has type char * remote-curl.c:220:75:right side has type int remote-curl.c:291:53: warning: Using plain integer as NULL pointer remote-curl.c:408:43: warning: Using plain integer as NULL pointer remote-curl.c:562:47: warning: Using plain integer as NULL pointer All of these complaints "blame" to commit 17243606 ("pkt-line: share buffer/descriptor reading implementation", 20-02-2013). In order to suppress the warnings, we simply replace the integer constant 0 with NULL. In order to suppress the error message, we simply remove the "> 0" from the while loop controlling expression. Signed-off-by: Ramsay Jones --- Hi Jeff, When you next re-roll your 'jk/pkt-line-cleanup' patches, could you please squash this (or something like it) into commit 17243606 ("pkt-line: share buffer/descriptor reading implementation", 20-02-2013). Please check the resolution of the sparse error, remote-curl.c:220, since I didn't think too deeply about it, making some assumptions ... ;-) Note: the commit message mentions an strbuf_get_line() function, but that is supposed to be packet_get_line(), right? In addition, that commit adds the following code as part of function get_packet_data(): + /* Read up to "size" bytes from our source, whatever it is. */ + if (src_buf && *src_buf) { + ret = size < *src_size ? size : *src_size; + memcpy(dst, *src_buf, ret); + *src_buf += size; ^ + *src_size -= size; + } else { + This could lead to the source buffer pointer being incremented past the "one past the end" of the buffer; ie to undefined behaviour. That use of 'size', along with the one on the following line, should be 'ret' no? ATB, Ramsay Jones daemon.c | 2 +- pkt-line.c| 2 +- remote-curl.c | 8 sideband.c| 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon.c b/daemon.c index 9a241d9..82d5bf5 100644 --- a/daemon.c +++ b/daemon.c @@ -612,7 +612,7 @@ static int execute(void) loginfo("Connection from %s:%s", addr, port); alarm(init_timeout ? init_timeout : timeout); - pktlen = packet_read(0, NULL, 0, packet_buffer, sizeof(packet_buffer), 0); + pktlen = packet_read(0, NULL, NULL, packet_buffer, sizeof(packet_buffer), 0); alarm(0); len = strlen(line); diff --git a/pkt-line.c b/pkt-line.c index 116d5f1..2793ecb 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -206,7 +206,7 @@ static char *packet_read_line_generic(int fd, char *packet_read_line(int fd, int *len_p) { - return packet_read_line_generic(fd, NULL, 0, len_p); + return packet_read_line_generic(fd, NULL, NULL, len_p); } char *packet_read_line_buf(char **src, size_t *src_len, int *dst_len) diff --git a/remote-curl.c b/remote-curl.c index 3d2b194..93a09a6 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -217,7 +217,7 @@ static struct discovery* discover_refs(const char *service, int for_push) * until a packet flush marker. Ignore these now, but * in the future we might start to scan them. */ - while (packet_read_line_buf(&last->buf, &last->len, NULL) > 0) + while (packet_read_line_buf(&last->buf, &last->len, NULL)) ; last->proto_git = 1; @@ -288,7 +288,7 @@ static size_t rpc_out(void *ptr, size_t eltsize, if (!avail) { rpc->initial_buffer = 0; - avail = packet_read(rpc->out, NULL, 0, rpc->buf, rpc->alloc, 0); + avail = packet_read(rpc->out, NULL, NULL, rpc->buf, rpc->alloc, 0); if (!avail) return 0; rpc->pos = 0; @@ -405,7 +405,7 @@ static int post_rpc(struct rpc_state *rpc) break; } - n = packet_read(rpc->out, 0, NULL, buf, left, 0); + n = packet_read(rpc->out, NULL, NULL, buf, left, 0); if (!n) break; rpc->len += n; @@ -559,7 +559,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads) rpc->hdr_accept = strbuf_detach(&buf, NULL); while (!err) { - int n = packet_read(rpc->out, 0, NULL, rpc->buf, rpc->alloc, 0); + int n = packet_read(rpc->out, NULL, NULL, rpc->buf, rpc->alloc, 0); if (!n) break; rpc->pos = 0; diff --git a/sideband.c b/sideband.c index 857954c..d1125f5 100644 --- a/sideband.c +++ b/sideban
Re: Suggested improvements to the git-p4 documentation (branch-related)
Pete Wyckoff writes: > All of it is in master now, via 801cbd7 (Merge branch > 'pw/p4-branch-fixes', 2013-01-21). > > I should have commented on this thread too. Thanks for following > up! 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 v3] branch: segfault fixes and validation
Nguyễn Thái Ngọc Duy writes: > > What you can do is to have a single helper function that can explain > > why branch_get() returned NULL (or extend branch_get() to serve that > > purpose as well); then you do not have to duplicate the logic twice > > on the caller's side (and there may be other callers that want to do > > the same). > > The explanation mentions about the failed operation, which makes a > helper less useful. We could still do the helper, but it may lead to > i18n legos. So no helper in this version. Who said explanation has to be conveyed in human language to the caller of the helper? Since there are only two possible cases, at least for now, and I do not think there will be countless many in the future, for the branch_get() function to fail, you can still do: int explain_error; struct branch *branch = branch_get(argv[0], &explain_error); switch (explain_error) { case DEFAULT_HEAD_DETACHED: case GIVEN_HEAD_DETACHED: die(_("could not make %s upstream of the current branch " "because you do not have one"), new_upstream); break; default: break; } and we could even fold the !ref_exists() check that is there for typo-detection purposes into the framework, e.g. case GIVEN_BRANCH_DOES_NOT_EXIST: die(_("you told me to make %s upstream of %s " "but the latter does not exist yet"), new_upstream, argv[0]); if we wanted to preserve what the current test does, no? > > The existing test might be wrong, by the way. Your HEAD may point > > at a branch Y but you may not have any commit on it yet, and you may > > want to allow setting the upstream of that to-be-born branch to > > another branch X with "branch --set-upstream-to=X [Y|HEAD]". > > It sounds complicated. I think we can revisit it when a user actually > complains about it. Yeah, will replace the previous one and queue this version. 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 for fix build git on Haiku
Hi, diger wrote: > This patch fixes build git on Haiku Lovely. May we have your sign-off? (See Documentation/SubmittingPatches for what this means.) Does "make test" pass? (Just curious --- it's fine if it doesn't, though in that case a list of test failures would be helpful.) Thanks, Jonathan (patch left unsnipped for reference) > --- Makefile.orig 2012-10-21 21:32:15.0 + > +++ Makefile > @@ -1211,6 +1204,16 @@ ifeq ($(uname_S),HP-UX) > endif > GIT_TEST_CMP = cmp > endif > +ifeq ($(uname_S),Haiku) > +NO_R_TO_GCC_LINKER = YesPlease > +NO_LIBGEN_H = YesPlease > +NO_MEMMEM = YesPlease > +NO_MKSTEMPS = YesPlease > +NEEDS_LIBICONV = YesPlease > +DEFAULT_EDITOR = nano > +PTHREAD_LIBS =-lroot > +NO_CROSS_DIRECTORY_HARDLINKS = YesPlease > +endif > ifeq ($(uname_S),Windows) > GIT_VERSION := $(GIT_VERSION).MSVC > pathsep = ; -- 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/2] update-index: list supported idx versions and their features
Nguyễn Thái Ngọc Duy wrote: > --- a/Documentation/git-update-index.txt > +++ b/Documentation/git-update-index.txt > @@ -145,7 +145,15 @@ you will need to handle the situation manually. > > --index-version :: > Write the resulting index out in the named on-disk format version. > - The current default version is 2. > + Supported versions are 2, 3 and 4. The current default version is 2 > + or 3, depending on whether extra features are used, such as > + `git add -N`. > ++ > + Version 4 performs a simple pathname compression that could > + reduce index size by 30%-50% on large repositories, which > + results in faster load time. Version 4 is relatively young > + (first released in 1.8.0 in October 2012). Other Git > + implementations may not support it yet. Markup nit: the second paragraph needs to be unindented, or asciidoc will treat it as literal text, including line breaks. Usage nit: s/could/can/ Clarity nit: something like "such as JGit and libgit2" after "Other Git implementations" would make it clearer, at least to my eyes. Aside from that, this looks like a good change. 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 v2 3/2] update-index: list supported idx versions and their features
Nguyễn Thái Ngọc Duy wrote: > Oops, bogus indentation in the first 3/2 Oops, I missed this. Ok, ignore the comment on indentation on v1. :) With or without the other changes I suggested, Reviewed-by: Jonathan Nieder -- 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] Documentation/githooks: Explain pre-rebase parameters
"W. Trevor King" writes: > +This hook is called by 'git rebase' and can be used to prevent a > +branch from getting rebased. The hook takes two parameters: the > +upstream the series was forked from and the branch being rebased. The > +second parameter will be missing when rebasing the current branch. takes one or two parameters? Other than that, looks good to me, but it took me two readings to notice where these two parameters are described. I have a feeling that a comma s/forked from and/forked from, and/; might make them a bit more spottable, but others may have better suggestions to make them stand out more. Thanks, will queue. > > post-checkout > ~ -- 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/2] update-index: list supported idx versions and their features
Thanks, both. Jonathan Nieder writes: > Nguyễn Thái Ngọc Duy wrote: > ... >> +Version 4 performs a simple pathname compression that could >> +reduce index size by 30%-50% on large repositories, which >> +results in faster load time. Version 4 is relatively young >> +(first released in 1.8.0 in October 2012). Other Git >> +implementations may not support it yet. > > Usage nit: s/could/can/ I think s/could reduce/reduces/ is even simpler. -- 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] update-index: allow "-h" to also display options
Antoine Pelisse writes: >> diff --git a/builtin/update-index.c b/builtin/update-index.c >> index ada1dff..3071ee6 100644 >> --- a/builtin/update-index.c >> +++ b/builtin/update-index.c >> @@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const >> char *prefix) >> }; >> >> if (argc == 2 && !strcmp(argv[1], "-h")) >> - usage(update_index_usage[0]); >> + usage_with_options(&update_index_usage[0], options); >> >> git_config(git_default_config, NULL); >> > > Ok I just realized that > > usage_with_options(update_index_usage, options); > > would be better... Yeah, that probably is easier on the eyes, even though they are equivalent. Thanks, will queue. -- 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] Documentation/githooks: Explain pre-rebase parameters
On Sat, Feb 23, 2013 at 01:21:59PM -0800, Junio C Hamano wrote: > "W. Trevor King" writes: > > > +This hook is called by 'git rebase' and can be used to prevent a > > +branch from getting rebased. The hook takes two parameters: the > > +upstream the series was forked from and the branch being rebased. The > > +second parameter will be missing when rebasing the current branch. > > takes one or two parameters? > > Other than that, looks good to me, but it took me two readings to > notice where these two parameters are described. I have a feeling > that a comma s/forked from and/forked from, and/; might make them a > bit more spottable, but others may have better suggestions to make > them stand out more. How about: The hook may be called with one or two parameters. The first parameter is the upstream from which the series was forked. The second parameter is the branch being rebased, and is not set when rebasing the current branch. -- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy signature.asc Description: OpenPGP digital signature
Re: [PATCH 3/2] update-index: list supported idx versions and their features
Junio C Hamano wrote: > Jonathan Nieder writes: >> Nguyễn Thái Ngọc Duy wrote: >>> + Version 4 performs a simple pathname compression that could >>> + reduce index size by 30%-50% on large repositories, which >>> + results in faster load time. Version 4 is relatively young >>> + (first released in 1.8.0 in October 2012). Other Git >>> + implementations may not support it yet. >> >> Usage nit: s/could/can/ > > I think s/could reduce/reduces/ is even simpler. Yes, true. 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
[PATCH] Improve QNX support in GIT
Hi, Here is a small patch with QNX build improvements: 1) Rename tar.h to tar_git.h. Latest QNX versions have system tar.h header according to http://pubs.opengroup.org/onlinepubs/009696699/basedefs/tar.h.html , to avoid inclusion of another tar.h, original header was renamed. 2) Rename fnmatch.h to fnmatch_gnu.h and fnmatch.c to fnmatch_gnu.c to avoid inclusion of system fnmatch.h header in case if -I/usr/include path is specified before -Icompat/fnmatch. Which is common situation. 3) pager.c - default "less" invocation flags were changed for QNX 6,x platform, since QNX has incompatible with GNU coreutils version of "less" utility. 4) config.mak.uname - a) do not override mkdtemp/mkstemps/strcasestr detection, since newer QNX version could contain such functions. Let to configure decide what is present in the system. b) getpagesize() function is existing under QNX, c) QNX has pthread functions in the libc, so do not define NO_PTHREAD macro. Thanks in advance! git-qnx.diff Description: Binary data
Re: [PATCH] pkt-line: Fix sparse errors and warnings
On Sat, Feb 23, 2013 at 06:44:04PM +, Ramsay Jones wrote: > Sparse issues the following error and warnings: > > pkt-line.c:209:51: warning: Using plain integer as NULL pointer > sideband.c:41:52: warning: Using plain integer as NULL pointer > daemon.c:615:39: warning: Using plain integer as NULL pointer > remote-curl.c:220:75: error: incompatible types for operation (>) > remote-curl.c:220:75:left side has type char * > remote-curl.c:220:75:right side has type int > remote-curl.c:291:53: warning: Using plain integer as NULL pointer > remote-curl.c:408:43: warning: Using plain integer as NULL pointer > remote-curl.c:562:47: warning: Using plain integer as NULL pointer > > All of these complaints "blame" to commit 17243606 ("pkt-line: share > buffer/descriptor reading implementation", 20-02-2013). > > In order to suppress the warnings, we simply replace the integer > constant 0 with NULL. Thanks for catching. This was just a think-o on my part; we want to pass (NULL, 0) as the (buf, len) pair, but of course we are passing pointers to them, so it is actually (NULL, NULL). And yes, I made sure the function correctly handles both a NULL pointer-to-buf and a NULL pointer-to-pointer-to-buf (and we do not even care about the pointer-to-len unless the buf pointer is valid). So no bug, but definitely a reasonable cleanup. Oddly, you seemed to miss the one in connect.c (which my sparse does detect). > In order to suppress the error message, we simply remove the "> 0" from > the while loop controlling expression. Yeah, that is the right thing to do. The code that's there isn't wrong, but I agree that checking "ptr != NULL" (i.e., just "ptr") is much more sane than "ptr > 0" (and is just a leftover that I missed during refactoring the patch). > When you next re-roll your 'jk/pkt-line-cleanup' patches, could you > please squash this (or something like it) into commit 17243606 > ("pkt-line: share buffer/descriptor reading implementation", 20-02-2013). I don't think we otherwise need a re-roll. Junio hasn't merged the series to next yet, so I've included an updated patch 15 below with your changes (your patch, the missing connect.c fix, the commit message fix, and the size/ret thing below). > In addition, that commit adds the following code as part of function > get_packet_data(): > > + /* Read up to "size" bytes from our source, whatever it is. */ > + if (src_buf && *src_buf) { > + ret = size < *src_size ? size : *src_size; > + memcpy(dst, *src_buf, ret); > + *src_buf += size; > ^ > + *src_size -= size; > + } else { > + > > This could lead to the source buffer pointer being incremented past the > "one past the end" of the buffer; ie to undefined behaviour. That use > of 'size', along with the one on the following line, should be 'ret' no? Yeah, thanks for catching. We just die immediately afterwards anyway, and sane systems do not care what kind of junk you put into a pointer unless you dereference. But clearly it is supposed to be "ret". Thanks for the report. Clearly I should start running "make sparse" more often (the reason I don't is that it produces dozens of complaints about constants in /usr/include/bits/xopen_lim.h, which I could obviously care less about; I should look into suppressing that). Updated patch 15/19 is below. -- >8 -- Subject: [PATCH] pkt-line: share buffer/descriptor reading implementation The packet_read function reads from a descriptor. The packet_get_line function is similar, but reads from an in-memory buffer, and uses a completely separate implementation. This patch teaches the generic packet_read function to accept either source, and we can do away with packet_get_line's implementation. There are two other differences to account for between the old and new functions. The first is that we used to read into a strbuf, but now read into a fixed size buffer. The only two callers are fine with that, and in fact it simplifies their code, since they can use the same static-buffer interface as the rest of the packet_read_line callers (and we provide a similar convenience wrapper for reading from a buffer rather than a descriptor). This is technically an externally-visible behavior change in that we used to accept arbitrary sized packets up to 65532 bytes, and now cap out at LARGE_PACKET_MAX, 65520. In practice this doesn't matter, as we use it only for parsing smart-http headers (of which there is exactly one defined, and it is small and fixed-size). And any extension headers would be breaking the protocol to go over LARGE_PACKET_MAX anyway. The other difference is that packet_get_line would return on error rather than dying. However, both callers of packet_get_line are actually improved by dying. The first caller does its own error checking, but we can drop that; as a result, we'll actually get more specific reporting about p
Re: [PATCH] pkt-line: Fix sparse errors and warnings
On Sat, Feb 23, 2013 at 05:31:34PM -0500, Jeff King wrote: > On Sat, Feb 23, 2013 at 06:44:04PM +, Ramsay Jones wrote: > > > Sparse issues the following error and warnings: > > > > pkt-line.c:209:51: warning: Using plain integer as NULL pointer > > sideband.c:41:52: warning: Using plain integer as NULL pointer > > daemon.c:615:39: warning: Using plain integer as NULL pointer > > remote-curl.c:220:75: error: incompatible types for operation (>) > > remote-curl.c:220:75:left side has type char * > > remote-curl.c:220:75:right side has type int > > remote-curl.c:291:53: warning: Using plain integer as NULL pointer > > remote-curl.c:408:43: warning: Using plain integer as NULL pointer > > remote-curl.c:562:47: warning: Using plain integer as NULL pointer > > > > All of these complaints "blame" to commit 17243606 ("pkt-line: share > > buffer/descriptor reading implementation", 20-02-2013). > > > > In order to suppress the warnings, we simply replace the integer > > constant 0 with NULL. > [...] > Oddly, you seemed to miss the one in connect.c (which my sparse does > detect). Ah, I saw why as soon as I finished off the rebase: that (NULL, 0) goes away in the very next patch, and you probably ran sparse just on the tip of the topic (via pu). I still think it's worth fixing since we are squashing anyway. Junio, it will give you a trivial conflict on patch 16, but you can just resolve in favor of what patch 16 does. If it's easier, here's the revised patch 16: -- >8 -- Subject: [PATCH] teach get_remote_heads to read from a memory buffer Now that we can read packet data from memory as easily as a descriptor, get_remote_heads can take either one as a source. This will allow further refactoring in remote-curl. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/fetch-pack.c | 2 +- builtin/send-pack.c | 2 +- cache.h | 4 +++- connect.c| 6 +++--- remote-curl.c| 2 +- transport.c | 6 +++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index c21cc2c..03ed2ca 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -125,7 +125,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) args.verbose ? CONNECT_VERBOSE : 0); } - get_remote_heads(fd[0], &ref, 0, NULL); + get_remote_heads(fd[0], NULL, 0, &ref, 0, NULL); ref = fetch_pack(&args, fd, conn, ref, dest, &sought, pack_lockfile_ptr); diff --git a/builtin/send-pack.c b/builtin/send-pack.c index 8778519..152c4ea 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -207,7 +207,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) memset(&extra_have, 0, sizeof(extra_have)); - get_remote_heads(fd[0], &remote_refs, REF_NORMAL, &extra_have); + get_remote_heads(fd[0], NULL, 0, &remote_refs, REF_NORMAL, &extra_have); transport_verify_remote_names(nr_refspecs, refspecs); diff --git a/cache.h b/cache.h index e493563..db646a2 100644 --- a/cache.h +++ b/cache.h @@ -1049,7 +1049,9 @@ struct extra_have_objects { int nr, alloc; unsigned char (*array)[20]; }; -extern struct ref **get_remote_heads(int in, struct ref **list, unsigned int flags, struct extra_have_objects *); +extern struct ref **get_remote_heads(int in, char *src_buf, size_t src_len, +struct ref **list, unsigned int flags, +struct extra_have_objects *); extern int server_supports(const char *feature); extern int parse_feature_request(const char *features, const char *feature); extern const char *server_feature_value(const char *feature, int *len_ret); diff --git a/connect.c b/connect.c index 3d9..f57efd0 100644 --- a/connect.c +++ b/connect.c @@ -62,8 +62,8 @@ static void die_initial_contact(int got_at_least_one_head) /* * Read all the refs from the other end */ -struct ref **get_remote_heads(int in, struct ref **list, - unsigned int flags, +struct ref **get_remote_heads(int in, char *src_buf, size_t src_len, + struct ref **list, unsigned int flags, struct extra_have_objects *extra_have) { int got_at_least_one_head = 0; @@ -76,7 +76,7 @@ struct ref **get_remote_heads(int in, struct ref **list, int len, name_len; char *buffer = packet_buffer; - len = packet_read(in, NULL, NULL, + len = packet_read(in, &src_buf, &src_len, packet_buffer, sizeof(packet_buffer), PACKET_READ_GENTLE_ON_EOF | PACKET_READ_CHOMP_NEWLINE); diff --git a/remote-curl.c b/remote-curl.c index c8379a5..24c8626 100644 --- a/remote-curl.c +++ b/re
[PATCH 00/13] Git help option to list user guides
The git help system will list common commands, and all commands if asked. However it is difficult for newer users to discover the guides that are available. This series seeks to add such an option to 'git help', and allow the user-manual and [git]everyday to be accessed in the same way. Patch 1 to 7 update the codebase and look to work correctly. Patch 1 & 3 are tidy ups. The code is very strongly based on the existing common-commands list so could be refactored and joined if the series is accepted. Patch 8 onward get into areas of the documentation Makefile that I need help on so that the user-manual and [git]everyday can follow the naming convention for guides and be picked up by the code. The intent is shown, but the Documentation/Makefile fails for the renamed gituser-manual and giteveryday - advice needed. I'm minded to make them have a man page format to simplify changes to the make file but haven't managed to get that format right. The alternative is to tweak the make file to cope with these 'pretty' documents yet still move them to their new names. (I'm unfamiliar with make files) Holding pages have been created for the vacated page locations in the same vein as used for Rename {git- => git}remote-helpers.txt The patches are built upon V1.8.2-rc0 which includes the recent user-manual changes. Initial discussion was at $gmane/215814/focus=216146 Philip Oakley (13): Use 'Git' in help messages Show 'git help ' usage, with examples Help.c use OPT_COUNTUP Help.c add --guide option Help.c: add list_common_guides_help() function Add guide-list.txt and extraction shell Extend name string for longer names Rename user-manual to gituser-manual Rename everyday to giteveryday Update Git(1) links to guides Add missing guides to list and regenerate Documentation/Makefile: update git guide links Fixup! doc: giteveryday and user-manual man format Documentation/Makefile |4 + Documentation/everyday.txt | 424 +--- Documentation/git.txt| 12 +- Documentation/giteveryday.txt| 419 Documentation/gituser-manual.txt | 4639 + Documentation/user-manual.txt| 4643 +- builtin/help.c | 11 +- common-guides.h | 15 + generate-cmdlist.sh |2 +- generate-guidelist.sh| 23 + git.c|4 +- guide-list.txt | 30 + help.c | 30 +- help.h |1 + 14 files changed, 5208 insertions(+), 5049 deletions(-) create mode 100644 Documentation/giteveryday.txt create mode 100644 Documentation/gituser-manual.txt create mode 100644 common-guides.h create mode 100644 generate-guidelist.sh create mode 100644 guide-list.txt -- 1.8.1.msysgit.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 01/13] Use 'Git' in help messages
Signed-off-by: Philip Oakley --- help.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/help.c b/help.c index 1dfa0b0..1c0e17d 100644 --- a/help.c +++ b/help.c @@ -209,14 +209,14 @@ void list_commands(unsigned int colopts, { if (main_cmds->cnt) { const char *exec_path = git_exec_path(); - printf_ln(_("available git commands in '%s'"), exec_path); + printf_ln(_("available Git commands in '%s'"), exec_path); putchar('\n'); pretty_print_string_list(main_cmds, colopts); putchar('\n'); } if (other_cmds->cnt) { - printf_ln(_("git commands available from elsewhere on your $PATH")); + printf_ln(_("Git commands available from elsewhere on your $PATH")); putchar('\n'); pretty_print_string_list(other_cmds, colopts); putchar('\n'); @@ -232,7 +232,7 @@ void list_common_cmds_help(void) longest = strlen(common_cmds[i].name); } - puts(_("The most commonly used git commands are:")); + puts(_("The most commonly used Git commands are:")); for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { printf(" %s ", common_cmds[i].name); mput_char(' ', longest - strlen(common_cmds[i].name)); @@ -289,7 +289,7 @@ static void add_cmd_list(struct cmdnames *cmds, struct cmdnames *old) #define SIMILAR_ENOUGH(x) ((x) < SIMILARITY_FLOOR) static const char bad_interpreter_advice[] = - N_("'%s' appears to be a git command, but we were not\n" + N_("'%s' appears to be a Git command, but we were not\n" "able to execute it. Maybe git-%s is broken?"); const char *help_unknown_cmd(const char *cmd) @@ -380,7 +380,7 @@ const char *help_unknown_cmd(const char *cmd) return assumed; } - fprintf_ln(stderr, _("git: '%s' is not a git command. See 'git --help'."), cmd); + fprintf_ln(stderr, _("git: '%s' is not a Git command. See 'git --help'."), cmd); if (SIMILAR_ENOUGH(best_similarity)) { fprintf_ln(stderr, @@ -397,6 +397,6 @@ const char *help_unknown_cmd(const char *cmd) int cmd_version(int argc, const char **argv, const char *prefix) { - printf("git version %s\n", git_version_string); + printf("Git version %s\n", git_version_string); return 0; } -- 1.8.1.msysgit.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 02/13] Show 'git help ' usage, with examples
The git(1) man page must be accessed via 'git help git' on Git for Windows as it has no 'man' command. And it prompts users to read the git(1) page, rather than hoping they follow a subsidiary link within another documentation page. The 'tutorial' is an obvious guide to suggest. Signed-off-by: Philip Oakley --- git.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git.c b/git.c index b10c18b..bf0e0de 100644 --- a/git.c +++ b/git.c @@ -13,7 +13,9 @@ const char git_usage_string[] = "[]"; const char git_more_info_string[] = - N_("See 'git help ' for more information on a specific command."); + N_("See 'git help ' for more information on a specific command.\n" + "While 'git help ', will show the selected Git concept guide.\n" + "Examples: 'git help git', 'git help branch', 'git help tutorial'.."); static struct startup_info git_startup_info; static int use_pager = -1; -- 1.8.1.msysgit.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 03/13] Help.c use OPT_COUNTUP
rename deprecated option in preparation for 'git help --guides'. Signed-off-by: Philip Oakley --- builtin/help.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/help.c b/builtin/help.c index d1d7181..d10cbed 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -39,7 +39,7 @@ static int show_all = 0; static unsigned int colopts; static enum help_format help_format = HELP_FORMAT_NONE; static struct option builtin_help_options[] = { - OPT_BOOLEAN('a', "all", &show_all, N_("print all available commands")), + OPT_COUNTUP('a', "all", &show_all, N_("print all available commands")), OPT_SET_INT('m', "man", &help_format, N_("show man page"), HELP_FORMAT_MAN), OPT_SET_INT('w', "web", &help_format, N_("show manual in web browser"), HELP_FORMAT_WEB), -- 1.8.1.msysgit.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 04/13] Help.c add --guide option
Logic, but no actions, included. Signed-off-by: Philip Oakley --- builtin/help.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/builtin/help.c b/builtin/help.c index d10cbed..699e679 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -36,10 +36,12 @@ enum help_format { static const char *html_path; static int show_all = 0; +static int show_guides = 0; static unsigned int colopts; static enum help_format help_format = HELP_FORMAT_NONE; static struct option builtin_help_options[] = { OPT_COUNTUP('a', "all", &show_all, N_("print all available commands")), + OPT_COUNTUP('g', "guides", &show_guides, N_("print all available guides")), OPT_SET_INT('m', "man", &help_format, N_("show man page"), HELP_FORMAT_MAN), OPT_SET_INT('w', "web", &help_format, N_("show manual in web browser"), HELP_FORMAT_WEB), @@ -49,7 +51,7 @@ static struct option builtin_help_options[] = { }; static const char * const builtin_help_usage[] = { - N_("git help [--all] [--man|--web|--info] [command]"), + N_("git help [--all] [--guides] [--man|--web|--info] [command]"), NULL }; @@ -429,9 +431,11 @@ int cmd_help(int argc, const char **argv, const char *prefix) printf(_("usage: %s%s"), _(git_usage_string), "\n\n"); list_commands(colopts, &main_cmds, &other_cmds); printf("%s\n", _(git_more_info_string)); + if (!show_guides) return 0; + } + if (show_guides) { return 0; } - if (!argv[0]) { printf(_("usage: %s%s"), _(git_usage_string), "\n\n"); list_common_cmds_help(); -- 1.8.1.msysgit.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 07/13] Extend name string for longer names
Signed-off-by: Philip Oakley --- generate-cmdlist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index 9a4c9b9..c25561f 100755 --- a/generate-cmdlist.sh +++ b/generate-cmdlist.sh @@ -2,7 +2,7 @@ echo "/* Automatically generated by $0 */ struct cmdname_help { -char name[16]; +char name[20]; char help[80]; }; -- 1.8.1.msysgit.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 06/13] Add guide-list.txt and extraction shell
The guide-list.txt uses exactly the same format as command-list.txt so could be merged as part of a refactoring. The category naming for each guide is an initial suggestion and is not yet used. Only those with the 'guide' prefix are copied by the generate-guidelist.sh into the common-guides.h file. The user-manual.txt and everyday.txt do not have the correct filename format yet. And gitrepository-layout.txt name is too long to include. So comment them out. Signed-off-by: Philip Oakley --- The shell script function N_() does not appear to work correctly on my Ubuntu lash-up, so an simpler script line is used with the original commented out. --- generate-guidelist.sh | 23 +++ guide-list.txt| 29 + 2 files changed, 52 insertions(+) create mode 100644 generate-guidelist.sh create mode 100644 guide-list.txt diff --git a/generate-guidelist.sh b/generate-guidelist.sh new file mode 100644 index 000..c0c98eb --- /dev/null +++ b/generate-guidelist.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Usage: ./generate-guidelist.sh >>common-guides.h +# based on generate-cmdlist.sh +echo "/* Automatically generated by $0 */ +/* re-use struct cmdname_help in common-commands.h */ + +static struct cmdname_help common_guides[] = {" + +sed -n -e 's/^git\([^ ]*\)[ ].* guide.*/\1/p' guide-list.txt | +sort | +while read guide +do + sed -n ' + /^NAME/,/git'"$guide"'/H + ${ + x +# s/.*git'"$guide"' - \(.*\)/ {"'"$guide"'", N_("\1")},/ + s/.*git'"$guide"' - \(.*\)/ {"'"$guide"'", "\1"},/ + p + }' "Documentation/git$guide.txt" +done +echo "};" + diff --git a/guide-list.txt b/guide-list.txt new file mode 100644 index 000..a419ac4 --- /dev/null +++ b/guide-list.txt @@ -0,0 +1,29 @@ +# List of known git guides. +# guide name category [deprecated] [common] [guide] +gitattributes concept guide +gitcore-tutorialspecialist +gitcredentials specialist +gitcvs-migrationspecialist +gitdiffcore specialist +gitglossary reference guide +githooksspecialist +gitignore concept guide +gitmodules concept guide +gitnamespaces specialist +#gitrepository-layoutreference guide +gitrevisionsconcept guide +gittutorial userguide +gittutorial-2 user +gitweb.conf specialist +gitweb specialist +gitworkflowsuserguide + +#giteveryday user guide +#gituser-manual user guide + +# could embed inside common-cmds.h with [guide] as the second thing, +# making the sed's in generate-cmdlist.sh more obvious +# but drop the dash in 's/^git-\ + +#gitrepository-layout is too long for the current char[16] +# -- 1.8.1.msysgit.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 05/13] Help.c: add list_common_guides_help() function
Re-use list_common_cmds_help but simply change the array name. Candidate for future refactoring to pass a pointer to the array. Do not list User-manual and Everday Git which not follow the naming convention, nor gitrepository-layout which doesn't fit within the name field size Signed-off-by: Philip Oakley --- builtin/help.c | 1 + common-guides.h | 12 help.c | 18 ++ help.h | 1 + 4 files changed, 32 insertions(+) create mode 100644 common-guides.h diff --git a/builtin/help.c b/builtin/help.c index 699e679..b0746af 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -434,6 +434,7 @@ int cmd_help(int argc, const char **argv, const char *prefix) if (!show_guides) return 0; } if (show_guides) { + list_common_guides_help(); return 0; } if (!argv[0]) { diff --git a/common-guides.h b/common-guides.h new file mode 100644 index 000..a8ad8d1 --- /dev/null +++ b/common-guides.h @@ -0,0 +1,12 @@ +/* Automatically generated by ./generate-guidelist.sh */ +/* re-use struct cmdname_help in common-commands.h */ + +static struct cmdname_help common_guides[] = { + {"attributes", "defining attributes per path"}, + {"glossary", "A GIT Glossary"}, + {"ignore", "Specifies intentionally untracked files to ignore"}, + {"modules", "defining submodule properties"}, + {"revisions", "specifying revisions and ranges for git"}, + {"tutorial", "A tutorial introduction to git (for version 1.5.1 or newer)"}, + {"workflows", "An overview of recommended workflows with git"}, +}; diff --git a/help.c b/help.c index 1c0e17d..94df446 100644 --- a/help.c +++ b/help.c @@ -4,6 +4,7 @@ #include "levenshtein.h" #include "help.h" #include "common-cmds.h" +#include "common-guides.h" #include "string-list.h" #include "column.h" #include "version.h" @@ -240,6 +241,23 @@ void list_common_cmds_help(void) } } +void list_common_guides_help(void) +{ + int i, longest = 0; + + for (i = 0; i < ARRAY_SIZE(common_guides); i++) { + if (longest < strlen(common_guides[i].name)) + longest = strlen(common_guides[i].name); + } + + puts(_("The common Git guides are:")); + for (i = 0; i < ARRAY_SIZE(common_guides); i++) { + printf(" %s ", common_guides[i].name); + mput_char(' ', longest - strlen(common_guides[i].name)); + puts(_(common_guides[i].help)); + } +} + int is_in_cmdlist(struct cmdnames *c, const char *s) { int i; diff --git a/help.h b/help.h index 0ae5a12..4ae1fd7 100644 --- a/help.h +++ b/help.h @@ -17,6 +17,7 @@ static inline void mput_char(char c, unsigned int num) } extern void list_common_cmds_help(void); +extern void list_common_guides_help(void); extern const char *help_unknown_cmd(const char *cmd); extern void load_command_list(const char *prefix, struct cmdnames *main_cmds, -- 1.8.1.msysgit.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 10/13] Update Git(1) links to guides
to giteverday and gituser-manual Signed-off-by: Philip Oakley --- Documentation/git.txt | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/git.txt b/Documentation/git.txt index 0b681d9..1830245 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -22,8 +22,8 @@ unusually rich command set that provides both high-level operations and full access to internals. See linkgit:gittutorial[7] to get started, then see -link:everyday.html[Everyday Git] for a useful minimum set of -commands. The link:user-manual.html[Git User's Manual] has a more +linkgit:giteveryday[Everyday Git] for a useful minimum set of +commands. The linkgit:gituser-manual[Git User's Manual] has a more in-depth introduction. After you mastered the basic concepts, you can come back to this @@ -826,7 +826,7 @@ Discussion[[Discussion]] More detail on the following is available from the -link:user-manual.html#git-concepts[Git concepts chapter of the +linkgit:gituser-manual#git-concepts[git concepts chapter of the user-manual] and linkgit:gitcore-tutorial[7]. A Git project normally consists of a working directory with a ".git" @@ -882,7 +882,7 @@ See the references in the "description" section to get started using Git. The following is probably more detail than necessary for a first-time user. -The link:user-manual.html#git-concepts[Git concepts chapter of the +The linkgit:gituser-manual#git-concepts[git concepts chapter of the user-manual] and linkgit:gitcore-tutorial[7] both provide introductions to the underlying Git architecture. @@ -919,9 +919,9 @@ subscribed to the list to send a message there. SEE ALSO linkgit:gittutorial[7], linkgit:gittutorial-2[7], -link:everyday.html[Everyday Git], linkgit:gitcvs-migration[7], +linkgit:giteveryday[Everyday Git], linkgit:gitcvs-migration[7], linkgit:gitglossary[7], linkgit:gitcore-tutorial[7], -linkgit:gitcli[7], link:user-manual.html[The Git User's Manual], +linkgit:gitcli[7], linkgit:gituser-manual[The Git User's Manual], linkgit:gitworkflows[7] GIT -- 1.8.1.msysgit.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 12/13] Documentation/Makefile: update git guide links
Signed-off-by: Philip Oakley --- Documentation/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/Makefile b/Documentation/Makefile index 62dbd9a..dc759a2 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -23,11 +23,13 @@ MAN7_TXT += gitcore-tutorial.txt MAN7_TXT += gitcredentials.txt MAN7_TXT += gitcvs-migration.txt MAN7_TXT += gitdiffcore.txt +MAN7_TXT += giteveryday.txt MAN7_TXT += gitglossary.txt MAN7_TXT += gitnamespaces.txt MAN7_TXT += gitrevisions.txt MAN7_TXT += gittutorial-2.txt MAN7_TXT += gittutorial.txt +MAN7_TXT += gituser-manual.txt MAN7_TXT += gitworkflows.txt MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT) @@ -35,6 +37,8 @@ MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT)) MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) OBSOLETE_HTML = git-remote-helpers.html +OBSOLETE_HTML = everyday.html +OBSOLETE_HTML = user-manual.html DOC_HTML=$(MAN_HTML) $(OBSOLETE_HTML) ARTICLES = howto-index -- 1.8.1.msysgit.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 13/13] Fixup! doc: giteveryday and user-manual man format
Signed-off-by: Philip Oakley --- Documentation/giteveryday.txt| 10 -- Documentation/gituser-manual.txt | 7 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/giteveryday.txt b/Documentation/giteveryday.txt index e1fba85..3f11787 100644 --- a/Documentation/giteveryday.txt +++ b/Documentation/giteveryday.txt @@ -1,6 +1,12 @@ -Everyday Git With 20 Commands Or So -=== +Everyday-Git(7) +=== +NAME + +giteveryday - A useful minimum set of commands for Everyday Git + +SYNOPSIS + <> commands are essential for anybody who makes a commit, even for somebody who works alone. diff --git a/Documentation/gituser-manual.txt b/Documentation/gituser-manual.txt index a4778d7..e991b11 100644 --- a/Documentation/gituser-manual.txt +++ b/Documentation/gituser-manual.txt @@ -1,7 +1,12 @@ Git User's Manual (for version 1.5.3 or newer) -__ +== +NAME + +gituser-manual - User Manual for Git, the stupid content tracker +SYNOPSIS + Git is a fast distributed revision control system. This manual is designed to be readable by someone with basic UNIX -- 1.8.1.msysgit.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 09/13] Rename everyday to giteveryday
and leave a 'page has moved' page. Signed-off-by: Philip Oakley --- Documentation/everyday.txt| 424 ++ Documentation/giteveryday.txt | 413 2 files changed, 431 insertions(+), 406 deletions(-) create mode 100644 Documentation/giteveryday.txt diff --git a/Documentation/everyday.txt b/Documentation/everyday.txt index e1fba85..3fc69f6 100644 --- a/Documentation/everyday.txt +++ b/Documentation/everyday.txt @@ -1,413 +1,25 @@ -Everyday Git With 20 Commands Or So +Everyday GIT With 20 Commands Or So === -<> commands are essential for -anybody who makes a commit, even for somebody who works alone. +NAME + +everyday - obsoleted page -If you work with other people, you will need commands listed in -the <> section as well. +SYNOPSIS + +See linkgit:giteveryday. -People who play the <> role need to learn some more -commands in addition to the above. +DESCRIPTION +--- +This document has been moved to linkgit:giteveryday. -<> commands are for system -administrators who are responsible for the care and feeding -of Git repositories. +Please let the owners of the referring site know so that they can update the +link you clicked to get here. +SEE ALSO + +linkgit:giteveryday -Individual Developer (Standalone)[[Individual Developer (Standalone)]] --- - -A standalone individual developer does not exchange patches with -other people, and works alone in a single repository, using the -following commands. - - * linkgit:git-init[1] to create a new repository. - - * linkgit:git-show-branch[1] to see where you are. - - * linkgit:git-log[1] to see what happened. - - * linkgit:git-checkout[1] and linkgit:git-branch[1] to switch -branches. - - * linkgit:git-add[1] to manage the index file. - - * linkgit:git-diff[1] and linkgit:git-status[1] to see what -you are in the middle of doing. - - * linkgit:git-commit[1] to advance the current branch. - - * linkgit:git-reset[1] and linkgit:git-checkout[1] (with -pathname parameters) to undo changes. - - * linkgit:git-merge[1] to merge between local branches. - - * linkgit:git-rebase[1] to maintain topic branches. - - * linkgit:git-tag[1] to mark known point. - -Examples - - -Use a tarball as a starting point for a new repository.:: -+ - -$ tar zxf frotz.tar.gz -$ cd frotz -$ git init -$ git add . <1> -$ git commit -m "import of frotz source tree." -$ git tag v2.43 <2> - -+ -<1> add everything under the current directory. -<2> make a lightweight, unannotated tag. - -Create a topic branch and develop.:: -+ - -$ git checkout -b alsa-audio <1> -$ edit/compile/test -$ git checkout -- curses/ux_audio_oss.c <2> -$ git add curses/ux_audio_alsa.c <3> -$ edit/compile/test -$ git diff HEAD <4> -$ git commit -a -s <5> -$ edit/compile/test -$ git reset --soft HEAD^ <6> -$ edit/compile/test -$ git diff ORIG_HEAD <7> -$ git commit -a -c ORIG_HEAD <8> -$ git checkout master <9> -$ git merge alsa-audio <10> -$ git log --since='3 days ago' <11> -$ git log v2.43.. curses/ <12> - -+ -<1> create a new topic branch. -<2> revert your botched changes in `curses/ux_audio_oss.c`. -<3> you need to tell Git if you added a new file; removal and -modification will be caught if you do `git commit -a` later. -<4> to see what changes you are committing. -<5> commit everything as you have tested, with your sign-off. -<6> take the last commit back, keeping what is in the working tree. -<7> look at the changes since the premature commit we took back. -<8> redo the commit undone in the previous step, using the message -you originally wrote. -<9> switch to the master branch. -<10> merge a topic branch into your master branch. -<11> review commit logs; other forms to limit output can be -combined and include `--max-count=10` (show 10 commits), -`--until=2005-12-10`, etc. -<12> view only the changes that touch what's in `curses/` -directory, since `v2.43` tag. - - -Individual Developer (Participant)[[Individual Developer (Participant)]] - - -A developer working as a participant in a group project needs to -learn how to communicate with others, and uses these commands in -addition to the ones needed by a standalone developer. - - * linkgit:git-clone[1] from the upstream to prime your local -repository. - - * linkgit:git-pull[1] and linkgit:git-fetch[1] from "origin" -to keep up-to-date with the upstream. - - * linkgit:git-push[1] to shared repository, if you adopt CVS -style shared repository workflow. - - * linkgit:git-format-patch[1] to prepare e-mail submission, if -you adopt Linux kernel-style public forum workflow. - -Examples - - -Clone the upstream and work on it. Feed changes to upstream.:: -+ - -$ git clone g
[PATCH 11/13] Add missing guides to list and regenerate
Signed-off-by: Philip Oakley --- common-guides.h | 3 +++ guide-list.txt | 17 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/common-guides.h b/common-guides.h index a8ad8d1..ae57d75 100644 --- a/common-guides.h +++ b/common-guides.h @@ -3,10 +3,13 @@ static struct cmdname_help common_guides[] = { {"attributes", "defining attributes per path"}, + {"everyday", "Everyday GIT With 20 Commands Or So"}, {"glossary", "A GIT Glossary"}, {"ignore", "Specifies intentionally untracked files to ignore"}, {"modules", "defining submodule properties"}, + {"repository-layout", "Git Repository Layout"}, {"revisions", "specifying revisions and ranges for git"}, {"tutorial", "A tutorial introduction to git (for version 1.5.1 or newer)"}, + {"user-manual", "Git User's Manual (for version 1.5.3 or newer)"}, {"workflows", "An overview of recommended workflows with git"}, }; diff --git a/guide-list.txt b/guide-list.txt index a419ac4..9ba1b5b 100644 --- a/guide-list.txt +++ b/guide-list.txt @@ -10,7 +10,7 @@ githooksspecialist gitignore concept guide gitmodules concept guide gitnamespaces specialist -#gitrepository-layoutreference guide +gitrepository-layoutreference guide gitrevisionsconcept guide gittutorial userguide gittutorial-2 user @@ -18,12 +18,13 @@ gitweb.conf specialist gitweb specialist gitworkflowsuserguide -#giteveryday user guide -#gituser-manual user guide +giteveryday userguide +gituser-manual userguide -# could embed inside common-cmds.h with [guide] as the second thing, -# making the sed's in generate-cmdlist.sh more obvious -# but drop the dash in 's/^git-\ +# Could embed inside common-cmds.h and move generate-guidelist.sh +# into generate-cmdlist.sh -#gitrepository-layout is too long for the current char[16] -# +# Could also extend generate-guidelist.sh to create a second, complete +# list of guides should -gg option be applied twice (It's a countup option) + +# use './generate-guidelist.sh >common-guides.h' to re-generate. -- 1.8.1.msysgit.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: [PATCH 01/13] Use 'Git' in help messages
On Sat, Feb 23, 2013 at 3:05 PM, Philip Oakley wrote: > Signed-off-by: Philip Oakley > --- > help.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/help.c b/help.c > index 1dfa0b0..1c0e17d 100644 > --- a/help.c > +++ b/help.c > @@ -209,14 +209,14 @@ void list_commands(unsigned int colopts, > { > if (main_cmds->cnt) { > const char *exec_path = git_exec_path(); > - printf_ln(_("available git commands in '%s'"), exec_path); > + printf_ln(_("available Git commands in '%s'"), exec_path); > putchar('\n'); > pretty_print_string_list(main_cmds, colopts); > putchar('\n'); > } > > if (other_cmds->cnt) { > - printf_ln(_("git commands available from elsewhere on your > $PATH")); > + printf_ln(_("Git commands available from elsewhere on your > $PATH")); > putchar('\n'); > pretty_print_string_list(other_cmds, colopts); > putchar('\n'); > @@ -232,7 +232,7 @@ void list_common_cmds_help(void) > longest = strlen(common_cmds[i].name); > } > > - puts(_("The most commonly used git commands are:")); > + puts(_("The most commonly used Git commands are:")); > for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { > printf(" %s ", common_cmds[i].name); > mput_char(' ', longest - strlen(common_cmds[i].name)); > @@ -289,7 +289,7 @@ static void add_cmd_list(struct cmdnames *cmds, struct > cmdnames *old) > #define SIMILAR_ENOUGH(x) ((x) < SIMILARITY_FLOOR) > > static const char bad_interpreter_advice[] = > - N_("'%s' appears to be a git command, but we were not\n" > + N_("'%s' appears to be a Git command, but we were not\n" > "able to execute it. Maybe git-%s is broken?"); > > const char *help_unknown_cmd(const char *cmd) > @@ -380,7 +380,7 @@ const char *help_unknown_cmd(const char *cmd) > return assumed; > } > > - fprintf_ln(stderr, _("git: '%s' is not a git command. See 'git > --help'."), cmd); > + fprintf_ln(stderr, _("git: '%s' is not a Git command. See 'git > --help'."), cmd); > > if (SIMILAR_ENOUGH(best_similarity)) { > fprintf_ln(stderr, > @@ -397,6 +397,6 @@ const char *help_unknown_cmd(const char *cmd) > > int cmd_version(int argc, const char **argv, const char *prefix) > { > - printf("git version %s\n", git_version_string); > + printf("Git version %s\n", git_version_string); > return 0; > } This is referring to "git the command", not "git the system", so it should not be changed according to the rule that was applied when many "git" strings were changed to "Git". There are scripts, etc. in the wild that parse this output. which is another reason we would not want to change this. Does the build system use this output somewhere? The other strings in this patch mention "git commands" which the user is expected to type, so it might make sense to leave them as-is as well. -- David -- 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 01/13] Use 'Git' in help messages
On 23/02/13 23:41, David Aguilar wrote: On Sat, Feb 23, 2013 at 3:05 PM, Philip Oakley wrote: Signed-off-by: Philip Oakley --- help.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/help.c b/help.c index 1dfa0b0..1c0e17d 100644 --- a/help.c +++ b/help.c @@ -209,14 +209,14 @@ void list_commands(unsigned int colopts, { if (main_cmds->cnt) { const char *exec_path = git_exec_path(); - printf_ln(_("available git commands in '%s'"), exec_path); + printf_ln(_("available Git commands in '%s'"), exec_path); putchar('\n'); pretty_print_string_list(main_cmds, colopts); putchar('\n'); } if (other_cmds->cnt) { - printf_ln(_("git commands available from elsewhere on your $PATH")); + printf_ln(_("Git commands available from elsewhere on your $PATH")); putchar('\n'); pretty_print_string_list(other_cmds, colopts); putchar('\n'); @@ -232,7 +232,7 @@ void list_common_cmds_help(void) longest = strlen(common_cmds[i].name); } - puts(_("The most commonly used git commands are:")); + puts(_("The most commonly used Git commands are:")); for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { printf(" %s ", common_cmds[i].name); mput_char(' ', longest - strlen(common_cmds[i].name)); @@ -289,7 +289,7 @@ static void add_cmd_list(struct cmdnames *cmds, struct cmdnames *old) #define SIMILAR_ENOUGH(x) ((x) < SIMILARITY_FLOOR) static const char bad_interpreter_advice[] = - N_("'%s' appears to be a git command, but we were not\n" + N_("'%s' appears to be a Git command, but we were not\n" "able to execute it. Maybe git-%s is broken?"); const char *help_unknown_cmd(const char *cmd) @@ -380,7 +380,7 @@ const char *help_unknown_cmd(const char *cmd) return assumed; } - fprintf_ln(stderr, _("git: '%s' is not a git command. See 'git --help'."), cmd); + fprintf_ln(stderr, _("git: '%s' is not a Git command. See 'git --help'."), cmd); if (SIMILAR_ENOUGH(best_similarity)) { fprintf_ln(stderr, @@ -397,6 +397,6 @@ const char *help_unknown_cmd(const char *cmd) int cmd_version(int argc, const char **argv, const char *prefix) { - printf("git version %s\n", git_version_string); + printf("Git version %s\n", git_version_string); return 0; } This is referring to "git the command", not "git the system", so it should not be changed according to the rule that was applied when many "git" strings were changed to "Git". I'd felt that they were referring to 'Git the system', hence the changes. There are scripts, etc. in the wild that parse this output. My first pass avoided the 'git --version' response on the basis that it might be used in the tests or elsewhere, but I didn't find an occurrence of it's use (in Git), so I thought 'why not'. However I'm not wedded to it. If the exact phrase 'git version' is parsed in the wild it then we should let it be. which is another reason we would not want to change this. Does the build system use this output somewhere? The other strings in this patch mention "git commands" which the user is expected to type, so it might make sense to leave them as-is as well. -- 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 00/16] make usage text consistent in git commands
Various helper commands around Git say "Usage: ..." when invoked as "git $cmd -h". This is inconsitent with the core git commands which all use the lowercase "usage: ..." form. Adjust these so that they match the convention used by builtin/help.c and git.c. I fixed a tiny problem in import-zips.py while I was in there, though it's unlikely that anyone uses such an old Python these days. There are still one or two results for "git grep Usage:" near the tests, but end users do not ever see them so I figured it was best to leave them as-is. David Aguilar (16): git-sh-setup: make usage text consistent git-svn: make usage text consistent git-relink: make usage text consistent git-merge-one-file: make usage text consistent git-archimport: make usage text consistent git-cvsexportcommit: make usage text consistent git-cvsimport: make usage text consistent git-cvsimport: make usage text consistent contrib/credential: make usage text consistent contrib/fast-import: make usage text consistent contrib/fast-import/import-zips.py: fix broken error message contrib/fast-import/import-zips.py: use spaces instead of tabs contrib/examples: make usage text consistent contrib/hooks/setgitperms.perl: make usage text consistent templates/hooks--update.sample: make usage text consistent Documentation/user-manual.txt: make usage text consistent Documentation/user-manual.txt | 4 +- .../gnome-keyring/git-credential-gnome-keyring.c | 2 +- .../osxkeychain/git-credential-osxkeychain.c | 2 +- .../credential/wincred/git-credential-wincred.c| 2 +- contrib/examples/git-remote.perl | 2 +- contrib/examples/git-svnimport.perl| 2 +- contrib/fast-import/git-import.perl| 2 +- contrib/fast-import/git-import.sh | 2 +- contrib/fast-import/import-zips.py | 98 +++--- contrib/hooks/setgitperms.perl | 2 +- git-archimport.perl| 2 +- git-cvsexportcommit.perl | 2 +- git-cvsimport.perl | 2 +- git-cvsserver.perl | 2 +- git-merge-one-file.sh | 2 +- git-relink.perl| 2 +- git-sh-setup.sh| 6 +- git-svn.perl | 2 +- templates/hooks--update.sample | 2 +- 19 files changed, 70 insertions(+), 70 deletions(-) -- 1.8.2.rc0.247.g811e0c0 -- 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 01/16] git-sh-setup: make usage text consistent
mergetool, bisect, and other commands that use git-sh-setup print a usage string that is inconsistent with the rest of Git when they are invoked as "git $cmd -h". The compiled builtins use the lowercase "usage:" string but these commands say "Usage:". Adjust the shell library to make these consistent. Signed-off-by: David Aguilar --- git-sh-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 795edd2..9cfbe7f 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -84,14 +84,14 @@ if test -n "$OPTIONS_SPEC"; then else dashless=$(basename "$0" | sed -e 's/-/ /') usage() { - die "Usage: $dashless $USAGE" + die "usage: $dashless $USAGE" } if [ -z "$LONG_USAGE" ] then - LONG_USAGE="Usage: $dashless $USAGE" + LONG_USAGE="usage: $dashless $USAGE" else - LONG_USAGE="Usage: $dashless $USAGE + LONG_USAGE="usage: $dashless $USAGE $LONG_USAGE" fi -- 1.8.2.rc0.247.g811e0c0 -- 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 02/16] git-svn: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- git-svn.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-svn.perl b/git-svn.perl index b46795f..a93166f 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -382,7 +382,7 @@ sub usage { my $fd = $exit ? \*STDERR : \*STDOUT; print $fd <<""; git-svn - bidirectional operations between a single Subversion tree and git -Usage: git svn [options] [arguments]\n +usage: git svn [options] [arguments]\n print $fd "Available commands:\n" unless $cmd; -- 1.8.2.rc0.247.g811e0c0 -- 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 04/16] git-merge-one-file: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- git-merge-one-file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index f612cb8..3373c04 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -18,7 +18,7 @@ USAGE=' ' USAGE="$USAGE " -LONG_USAGE="Usage: git merge-one-file $USAGE +LONG_USAGE="usage: git merge-one-file $USAGE Blob ids and modes should be empty for missing files." -- 1.8.2.rc0.247.g811e0c0 -- 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 06/16] git-cvsexportcommit: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- git-cvsexportcommit.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index e6bf252..d13f02d 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -420,7 +420,7 @@ sleep(1); sub usage { print STDERR
[PATCH 07/16] git-cvsimport: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- git-cvsimport.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 344f120..73d367c 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -38,7 +38,7 @@ sub usage(;$) { my $msg = shift; print(STDERR "Error: $msg\n") if $msg; print STDERR
[PATCH 08/16] git-cvsimport: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- git-cvsserver.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 3679074..f1c3f49 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -107,7 +107,7 @@ my $work = $log->info("--- STARTING -"); my $usage = -"Usage: git cvsserver [options] [pserver|server] [ ...]\n". +"usage: git cvsserver [options] [pserver|server] [ ...]\n". "--base-path : Prepend to requested CVSROOT\n". " Can be read from GIT_CVSSERVER_BASE_PATH\n". "--strict-paths : Don't allow recursing into subdirectories\n". -- 1.8.2.rc0.247.g811e0c0 -- 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 10/16] contrib/fast-import: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- contrib/fast-import/git-import.perl | 2 +- contrib/fast-import/git-import.sh | 2 +- contrib/fast-import/import-zips.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/fast-import/git-import.perl b/contrib/fast-import/git-import.perl index f9fef6d..0891b9e 100755 --- a/contrib/fast-import/git-import.perl +++ b/contrib/fast-import/git-import.perl @@ -7,7 +7,7 @@ use strict; use File::Find; -my $USAGE = 'Usage: git-import branch import-message'; +my $USAGE = 'usage: git-import branch import-message'; my $branch = shift or die "$USAGE\n"; my $message = shift or die "$USAGE\n"; diff --git a/contrib/fast-import/git-import.sh b/contrib/fast-import/git-import.sh index 0ca7718..f8d803c 100755 --- a/contrib/fast-import/git-import.sh +++ b/contrib/fast-import/git-import.sh @@ -5,7 +5,7 @@ # but is meant to be a simple fast-import example. if [ -z "$1" -o -z "$2" ]; then - echo "Usage: git-import branch import-message" + echo "usage: git-import branch import-message" exit 1 fi diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index 5cec9b0..f54c65b 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -19,7 +19,7 @@ if hexversion < 0x0106: sys.exit(1) if len(argv) < 2: - print 'Usage:', argv[0], '...' + print 'usage:', argv[0], '...' exit(1) branch_ref = 'refs/heads/import-zips' -- 1.8.2.rc0.247.g811e0c0 -- 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 09/16] contrib/credential: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- contrib/credential/osxkeychain/git-credential-osxkeychain.c | 2 +- contrib/credential/wincred/git-credential-wincred.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c index 41f61c5..f2cdefe 100644 --- a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c +++ b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c @@ -401,7 +401,7 @@ static void usage(const char *name) const char *basename = strrchr(name,'/'); basename = (basename) ? basename + 1 : name; - fprintf(stderr, "Usage: %s <", basename); + fprintf(stderr, "usage: %s <", basename); while(try_op->name) { fprintf(stderr,"%s",(try_op++)->name); if(try_op->name) diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c index 6beed12..3940202 100644 --- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c +++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c @@ -154,7 +154,7 @@ static void read_credential(void) int main(int argc, const char **argv) { const char *usage = - "Usage: git credential-osxkeychain "; + "usage: git credential-osxkeychain "; if (!argv[1]) die(usage); diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c index cbaec5f..6619492 100644 --- a/contrib/credential/wincred/git-credential-wincred.c +++ b/contrib/credential/wincred/git-credential-wincred.c @@ -313,7 +313,7 @@ static void read_credential(void) int main(int argc, char *argv[]) { const char *usage = - "Usage: git credential-wincred \n"; + "usage: git credential-wincred \n"; if (!argv[1]) die(usage); -- 1.8.2.rc0.247.g811e0c0 -- 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 12/16] contrib/fast-import/import-zips.py: use spaces instead of tabs
Follow the conventional Python style by using 4-space indents instead of hard tabs. Signed-off-by: David Aguilar --- contrib/fast-import/import-zips.py | 98 +++--- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index b528798..d12c296 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -14,13 +14,13 @@ from time import mktime from zipfile import ZipFile if hexversion < 0x0106: - # The limiter is the zipfile module - stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") - exit(1) +# The limiter is the zipfile module +stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") +exit(1) if len(argv) < 2: - print 'usage:', argv[0], '...' - exit(1) +print 'usage:', argv[0], '...' +exit(1) branch_ref = 'refs/heads/import-zips' committer_name = 'Z Ip Creator' @@ -28,51 +28,51 @@ committer_email = 'z...@example.com' fast_import = popen('git fast-import --quiet', 'w') def printlines(list): - for str in list: - fast_import.write(str + "\n") +for str in list: +fast_import.write(str + "\n") for zipfile in argv[1:]: - commit_time = 0 - next_mark = 1 - common_prefix = None - mark = dict() - - zip = ZipFile(zipfile, 'r') - for name in zip.namelist(): - if name.endswith('/'): - continue - info = zip.getinfo(name) - - if commit_time < info.date_time: - commit_time = info.date_time - if common_prefix == None: - common_prefix = name[:name.rfind('/') + 1] - else: - while not name.startswith(common_prefix): - last_slash = common_prefix[:-1].rfind('/') + 1 - common_prefix = common_prefix[:last_slash] - - mark[name] = ':' + str(next_mark) - next_mark += 1 - - printlines(('blob', 'mark ' + mark[name], \ - 'data ' + str(info.file_size))) - fast_import.write(zip.read(name) + "\n") - - committer = committer_name + ' <' + committer_email + '> %d +' % \ - mktime(commit_time + (0, 0, 0)) - - printlines(('commit ' + branch_ref, 'committer ' + committer, \ - 'data < %d +' % \ +mktime(commit_time + (0, 0, 0)) + +printlines(('commit ' + branch_ref, 'committer ' + committer, \ +'data
[PATCH 14/16] contrib/hooks/setgitperms.perl: make usage text consistent
Use a lowercase "usage:" string for consistency with Git with Git with Git with Git. Signed-off-by: David Aguilar --- contrib/hooks/setgitperms.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/hooks/setgitperms.perl b/contrib/hooks/setgitperms.perl index a577ad0..2770a1b 100644 --- a/contrib/hooks/setgitperms.perl +++ b/contrib/hooks/setgitperms.perl @@ -24,7 +24,7 @@ use File::Find; use File::Basename; my $usage = -"Usage: setgitperms.perl [OPTION]... <--read|--write> +"usage: setgitperms.perl [OPTION]... <--read|--write> This program uses a file `.gitmeta` to store/restore permissions and uid/gid info for all files/dirs tracked by git in the repository. -- 1.8.2.rc0.247.g811e0c0 -- 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 13/16] contrib/examples: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- contrib/examples/git-remote.perl| 2 +- contrib/examples/git-svnimport.perl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl index b17952a..b549a3c 100755 --- a/contrib/examples/git-remote.perl +++ b/contrib/examples/git-remote.perl @@ -347,7 +347,7 @@ sub rm_remote { } sub add_usage { - print STDERR "Usage: git remote add [-f] [-t track]* [-m master] \n"; + print STDERR "usage: git remote add [-f] [-t track]* [-m master] \n"; exit(1); } diff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl index b09ff8f..c414f0d 100755 --- a/contrib/examples/git-svnimport.perl +++ b/contrib/examples/git-svnimport.perl @@ -36,7 +36,7 @@ our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T, sub usage() { print STDERR
[PATCH 15/16] templates/hooks--update.sample: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- templates/hooks--update.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample index 71ab04e..d847583 100755 --- a/templates/hooks--update.sample +++ b/templates/hooks--update.sample @@ -38,7 +38,7 @@ if [ -z "$GIT_DIR" ]; then fi if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "Usage: $0 " >&2 + echo "usage: $0 " >&2 exit 1 fi -- 1.8.2.rc0.247.g811e0c0 -- 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 11/16] contrib/fast-import/import-zips.py: fix broken error message
The 'sys' module is not imported but all of the bits we want from it are. Adjust the script to not fail when run on old Python versions and fix the inconsistent use of tabs. Signed-off-by: David Aguilar --- contrib/fast-import/import-zips.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index f54c65b..b528798 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -14,9 +14,9 @@ from time import mktime from zipfile import ZipFile if hexversion < 0x0106: -# The limiter is the zipfile module -sys.stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") -sys.exit(1) + # The limiter is the zipfile module + stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") + exit(1) if len(argv) < 2: print 'usage:', argv[0], '...' -- 1.8.2.rc0.247.g811e0c0 -- 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 05/16] git-archimport: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- git-archimport.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-archimport.perl b/git-archimport.perl index bc32f18..9cb123a 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -75,7 +75,7 @@ our($opt_h,$opt_f,$opt_v,$opt_T,$opt_t,$opt_D,$opt_a,$opt_o); sub usage() { print STDERR
[PATCH 03/16] git-relink: make usage text consistent
Use a lowercase "usage:" string for consistency with Git. Signed-off-by: David Aguilar --- git-relink.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-relink.perl b/git-relink.perl index f29285c..236a352 100755 --- a/git-relink.perl +++ b/git-relink.perl @@ -163,7 +163,7 @@ sub link_two_files($$) { sub usage() { - print("Usage: git relink [--safe] ... \n"); + print("usage: git relink [--safe] ... \n"); print("All directories should contain a .git/objects/ subdirectory.\n"); print("Options\n"); print("\t--safe\t" . -- 1.8.2.rc0.247.g811e0c0 -- 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 16/16] Documentation/user-manual.txt: make usage text consistent
Use a lowercase "usage:" string in the example script for consistency with Git. Signed-off-by: David Aguilar --- Documentation/user-manual.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 5f36f81..35a279a 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -2337,7 +2337,7 @@ origin) fi ;; *) - echo "Usage: $0 origin|test|release" 1>&2 + echo "usage: $0 origin|test|release" 1>&2 exit 1 ;; esac @@ -2351,7 +2351,7 @@ pname=$0 usage() { - echo "Usage: $pname branch test|release" 1>&2 + echo "usage: $pname branch test|release" 1>&2 exit 1 } -- 1.8.2.rc0.247.g811e0c0 -- 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 01/16] git-sh-setup: make usage text consistent
David Aguilar wrote: > mergetool, bisect, and other commands that use > git-sh-setup print a usage string that is inconsistent > with the rest of Git when they are invoked as "git $cmd -h". > > The compiled builtins use the lowercase "usage:" string > but these commands say "Usage:". Adjust the shell library > to make these consistent. Scripts could be grepping for Usage:, but they are asking for trouble and if anything should check for status 129 instead. And luckily we have been careful about not checking for this in tests. Thanks for the fix. Reviewed-by: Jonathan Nieder -- 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/16] make usage text consistent in git commands
David Aguilar wrote: > git-sh-setup: make usage text consistent > git-svn: make usage text consistent > git-relink: make usage text consistent [...] Micronit: titles like git-relink: use a lowercase "usage:" string would make the effect of these patches easier to see in the shortlog. With or without that change, all of these except patches 11 and 12 are Reviewed-by: Jonathan Nieder I have no opinion about patches 11 and 12. :) 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 00/16] make usage text consistent in git commands
On Sat, Feb 23, 2013 at 4:29 PM, Jonathan Nieder wrote: > David Aguilar wrote: > >> git-sh-setup: make usage text consistent >> git-svn: make usage text consistent >> git-relink: make usage text consistent > [...] > > Micronit: titles like > > git-relink: use a lowercase "usage:" string > > would make the effect of these patches easier to see in the > shortlog. > > With or without that change, all of these except patches 11 and 12 are > Reviewed-by: Jonathan Nieder > > I have no opinion about patches 11 and 12. :) Thanks for the review. I will post a re-roll later to fix these. -- David -- 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 00/16] use a lowercase "usage:" string
The code content is unchanged from v1. v2 adjusts the commit messages per Jonathan's review and adds a Reviewed-by: to the commit message except for patches 11 and 12, which are unchanged since v1. David Aguilar (16): git-sh-setup: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string git-relink: use a lowercase "usage:" string git-merge-one-file: use a lowercase "usage:" string git-archimport: use a lowercase "usage:" string git-cvsexportcommit: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string contrib/credential: use a lowercase "usage:" string contrib/fast-import: use a lowercase "usage:" string contrib/fast-import/import-zips.py: fix broken error message contrib/fast-import/import-zips.py: use spaces instead of tabs contrib/examples: use a lowercase "usage:" string contrib/hooks/setgitperms.perl: use a lowercase "usage:" string templates/hooks--update.sample: use a lowercase "usage:" string Documentation/user-manual.txt: use a lowercase "usage:" string Documentation/user-manual.txt | 4 +- .../gnome-keyring/git-credential-gnome-keyring.c | 2 +- .../osxkeychain/git-credential-osxkeychain.c | 2 +- .../credential/wincred/git-credential-wincred.c| 2 +- contrib/examples/git-remote.perl | 2 +- contrib/examples/git-svnimport.perl| 2 +- contrib/fast-import/git-import.perl| 2 +- contrib/fast-import/git-import.sh | 2 +- contrib/fast-import/import-zips.py | 98 +++--- contrib/hooks/setgitperms.perl | 2 +- git-archimport.perl| 2 +- git-cvsexportcommit.perl | 2 +- git-cvsimport.perl | 2 +- git-cvsserver.perl | 2 +- git-merge-one-file.sh | 2 +- git-relink.perl| 2 +- git-sh-setup.sh| 6 +- git-svn.perl | 2 +- templates/hooks--update.sample | 2 +- 19 files changed, 70 insertions(+), 70 deletions(-) -- 1.8.2.rc0.263.g20d9441 -- 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 01/16] git-sh-setup: use a lowercase "usage:" string
mergetool, bisect, and other commands that use git-sh-setup print a usage string that is inconsistent with the rest of Git when they are invoked as "git $cmd -h". The compiled builtins use the lowercase "usage:" string but these commands say "Usage:". Adjust the shell library to make these consistent. Signed-off-by: David Aguilar --- git-sh-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 795edd2..9cfbe7f 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -84,14 +84,14 @@ if test -n "$OPTIONS_SPEC"; then else dashless=$(basename "$0" | sed -e 's/-/ /') usage() { - die "Usage: $dashless $USAGE" + die "usage: $dashless $USAGE" } if [ -z "$LONG_USAGE" ] then - LONG_USAGE="Usage: $dashless $USAGE" + LONG_USAGE="usage: $dashless $USAGE" else - LONG_USAGE="Usage: $dashless $USAGE + LONG_USAGE="usage: $dashless $USAGE $LONG_USAGE" fi -- 1.8.2.rc0.263.g20d9441 -- 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 02/16] git-svn: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- git-svn.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-svn.perl b/git-svn.perl index b46795f..a93166f 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -382,7 +382,7 @@ sub usage { my $fd = $exit ? \*STDERR : \*STDOUT; print $fd <<""; git-svn - bidirectional operations between a single Subversion tree and git -Usage: git svn [options] [arguments]\n +usage: git svn [options] [arguments]\n print $fd "Available commands:\n" unless $cmd; -- 1.8.2.rc0.263.g20d9441 -- 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 03/16] git-relink: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- git-relink.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-relink.perl b/git-relink.perl index f29285c..236a352 100755 --- a/git-relink.perl +++ b/git-relink.perl @@ -163,7 +163,7 @@ sub link_two_files($$) { sub usage() { - print("Usage: git relink [--safe] ... \n"); + print("usage: git relink [--safe] ... \n"); print("All directories should contain a .git/objects/ subdirectory.\n"); print("Options\n"); print("\t--safe\t" . -- 1.8.2.rc0.263.g20d9441 -- 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 04/16] git-merge-one-file: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- git-merge-one-file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index f612cb8..3373c04 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -18,7 +18,7 @@ USAGE=' ' USAGE="$USAGE " -LONG_USAGE="Usage: git merge-one-file $USAGE +LONG_USAGE="usage: git merge-one-file $USAGE Blob ids and modes should be empty for missing files." -- 1.8.2.rc0.263.g20d9441 -- 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 05/16] git-archimport: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- git-archimport.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-archimport.perl b/git-archimport.perl index bc32f18..9cb123a 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -75,7 +75,7 @@ our($opt_h,$opt_f,$opt_v,$opt_T,$opt_t,$opt_D,$opt_a,$opt_o); sub usage() { print STDERR
[PATCH v2 06/16] git-cvsexportcommit: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- git-cvsexportcommit.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index e6bf252..d13f02d 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -420,7 +420,7 @@ sleep(1); sub usage { print STDERR
[PATCH v2 07/16] git-cvsimport: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- git-cvsimport.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 344f120..73d367c 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -38,7 +38,7 @@ sub usage(;$) { my $msg = shift; print(STDERR "Error: $msg\n") if $msg; print STDERR
[PATCH v2 08/16] git-cvsimport: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- git-cvsserver.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 3679074..f1c3f49 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -107,7 +107,7 @@ my $work = $log->info("--- STARTING -"); my $usage = -"Usage: git cvsserver [options] [pserver|server] [ ...]\n". +"usage: git cvsserver [options] [pserver|server] [ ...]\n". "--base-path : Prepend to requested CVSROOT\n". " Can be read from GIT_CVSSERVER_BASE_PATH\n". "--strict-paths : Don't allow recursing into subdirectories\n". -- 1.8.2.rc0.263.g20d9441 -- 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 09/16] contrib/credential: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- contrib/credential/osxkeychain/git-credential-osxkeychain.c | 2 +- contrib/credential/wincred/git-credential-wincred.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c index 41f61c5..f2cdefe 100644 --- a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c +++ b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c @@ -401,7 +401,7 @@ static void usage(const char *name) const char *basename = strrchr(name,'/'); basename = (basename) ? basename + 1 : name; - fprintf(stderr, "Usage: %s <", basename); + fprintf(stderr, "usage: %s <", basename); while(try_op->name) { fprintf(stderr,"%s",(try_op++)->name); if(try_op->name) diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c index 6beed12..3940202 100644 --- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c +++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c @@ -154,7 +154,7 @@ static void read_credential(void) int main(int argc, const char **argv) { const char *usage = - "Usage: git credential-osxkeychain "; + "usage: git credential-osxkeychain "; if (!argv[1]) die(usage); diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c index cbaec5f..6619492 100644 --- a/contrib/credential/wincred/git-credential-wincred.c +++ b/contrib/credential/wincred/git-credential-wincred.c @@ -313,7 +313,7 @@ static void read_credential(void) int main(int argc, char *argv[]) { const char *usage = - "Usage: git credential-wincred \n"; + "usage: git credential-wincred \n"; if (!argv[1]) die(usage); -- 1.8.2.rc0.263.g20d9441 -- 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 10/16] contrib/fast-import: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- contrib/fast-import/git-import.perl | 2 +- contrib/fast-import/git-import.sh | 2 +- contrib/fast-import/import-zips.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/fast-import/git-import.perl b/contrib/fast-import/git-import.perl index f9fef6d..0891b9e 100755 --- a/contrib/fast-import/git-import.perl +++ b/contrib/fast-import/git-import.perl @@ -7,7 +7,7 @@ use strict; use File::Find; -my $USAGE = 'Usage: git-import branch import-message'; +my $USAGE = 'usage: git-import branch import-message'; my $branch = shift or die "$USAGE\n"; my $message = shift or die "$USAGE\n"; diff --git a/contrib/fast-import/git-import.sh b/contrib/fast-import/git-import.sh index 0ca7718..f8d803c 100755 --- a/contrib/fast-import/git-import.sh +++ b/contrib/fast-import/git-import.sh @@ -5,7 +5,7 @@ # but is meant to be a simple fast-import example. if [ -z "$1" -o -z "$2" ]; then - echo "Usage: git-import branch import-message" + echo "usage: git-import branch import-message" exit 1 fi diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index 5cec9b0..f54c65b 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -19,7 +19,7 @@ if hexversion < 0x0106: sys.exit(1) if len(argv) < 2: - print 'Usage:', argv[0], '...' + print 'usage:', argv[0], '...' exit(1) branch_ref = 'refs/heads/import-zips' -- 1.8.2.rc0.263.g20d9441 -- 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 11/16] contrib/fast-import/import-zips.py: fix broken error message
The 'sys' module is not imported but all of the bits we want from it are. Adjust the script to not fail when run on old Python versions and fix the inconsistent use of tabs. Signed-off-by: David Aguilar --- contrib/fast-import/import-zips.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index f54c65b..b528798 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -14,9 +14,9 @@ from time import mktime from zipfile import ZipFile if hexversion < 0x0106: -# The limiter is the zipfile module -sys.stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") -sys.exit(1) + # The limiter is the zipfile module + stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") + exit(1) if len(argv) < 2: print 'usage:', argv[0], '...' -- 1.8.2.rc0.263.g20d9441 -- 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 12/16] contrib/fast-import/import-zips.py: use spaces instead of tabs
Follow the conventional Python style by using 4-space indents instead of hard tabs. Signed-off-by: David Aguilar --- contrib/fast-import/import-zips.py | 98 +++--- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index b528798..d12c296 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -14,13 +14,13 @@ from time import mktime from zipfile import ZipFile if hexversion < 0x0106: - # The limiter is the zipfile module - stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") - exit(1) +# The limiter is the zipfile module +stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") +exit(1) if len(argv) < 2: - print 'usage:', argv[0], '...' - exit(1) +print 'usage:', argv[0], '...' +exit(1) branch_ref = 'refs/heads/import-zips' committer_name = 'Z Ip Creator' @@ -28,51 +28,51 @@ committer_email = 'z...@example.com' fast_import = popen('git fast-import --quiet', 'w') def printlines(list): - for str in list: - fast_import.write(str + "\n") +for str in list: +fast_import.write(str + "\n") for zipfile in argv[1:]: - commit_time = 0 - next_mark = 1 - common_prefix = None - mark = dict() - - zip = ZipFile(zipfile, 'r') - for name in zip.namelist(): - if name.endswith('/'): - continue - info = zip.getinfo(name) - - if commit_time < info.date_time: - commit_time = info.date_time - if common_prefix == None: - common_prefix = name[:name.rfind('/') + 1] - else: - while not name.startswith(common_prefix): - last_slash = common_prefix[:-1].rfind('/') + 1 - common_prefix = common_prefix[:last_slash] - - mark[name] = ':' + str(next_mark) - next_mark += 1 - - printlines(('blob', 'mark ' + mark[name], \ - 'data ' + str(info.file_size))) - fast_import.write(zip.read(name) + "\n") - - committer = committer_name + ' <' + committer_email + '> %d +' % \ - mktime(commit_time + (0, 0, 0)) - - printlines(('commit ' + branch_ref, 'committer ' + committer, \ - 'data < %d +' % \ +mktime(commit_time + (0, 0, 0)) + +printlines(('commit ' + branch_ref, 'committer ' + committer, \ +'data
[PATCH v2 13/16] contrib/examples: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- contrib/examples/git-remote.perl| 2 +- contrib/examples/git-svnimport.perl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl index b17952a..b549a3c 100755 --- a/contrib/examples/git-remote.perl +++ b/contrib/examples/git-remote.perl @@ -347,7 +347,7 @@ sub rm_remote { } sub add_usage { - print STDERR "Usage: git remote add [-f] [-t track]* [-m master] \n"; + print STDERR "usage: git remote add [-f] [-t track]* [-m master] \n"; exit(1); } diff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl index b09ff8f..c414f0d 100755 --- a/contrib/examples/git-svnimport.perl +++ b/contrib/examples/git-svnimport.perl @@ -36,7 +36,7 @@ our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T, sub usage() { print STDERR
[PATCH v2 14/16] contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- contrib/hooks/setgitperms.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/hooks/setgitperms.perl b/contrib/hooks/setgitperms.perl index a577ad0..2770a1b 100644 --- a/contrib/hooks/setgitperms.perl +++ b/contrib/hooks/setgitperms.perl @@ -24,7 +24,7 @@ use File::Find; use File::Basename; my $usage = -"Usage: setgitperms.perl [OPTION]... <--read|--write> +"usage: setgitperms.perl [OPTION]... <--read|--write> This program uses a file `.gitmeta` to store/restore permissions and uid/gid info for all files/dirs tracked by git in the repository. -- 1.8.2.rc0.263.g20d9441 -- 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 15/16] templates/hooks--update.sample: use a lowercase "usage:" string
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- templates/hooks--update.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample index 71ab04e..d847583 100755 --- a/templates/hooks--update.sample +++ b/templates/hooks--update.sample @@ -38,7 +38,7 @@ if [ -z "$GIT_DIR" ]; then fi if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "Usage: $0 " >&2 + echo "usage: $0 " >&2 exit 1 fi -- 1.8.2.rc0.263.g20d9441 -- 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 16/16] Documentation/user-manual.txt: use a lowercase "usage:" string
Make the usage string in the example script consistent with Git. Reviewed-by: Jonathan Nieder Signed-off-by: David Aguilar --- Documentation/user-manual.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 5f36f81..35a279a 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -2337,7 +2337,7 @@ origin) fi ;; *) - echo "Usage: $0 origin|test|release" 1>&2 + echo "usage: $0 origin|test|release" 1>&2 exit 1 ;; esac @@ -2351,7 +2351,7 @@ pname=$0 usage() { - echo "Usage: $pname branch test|release" 1>&2 + echo "usage: $pname branch test|release" 1>&2 exit 1 } -- 1.8.2.rc0.263.g20d9441 -- 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 v2] git-multimail: a replacement for post-receive-email
On 02/20/2013 01:28 PM, Matthieu Moy wrote: > Michael Haggerty writes: >> A while ago, I submitted an RFC for adding a new email notification >> script to "contrib" [...] > > We've discussed offline with Michael, a few patches have been merged, > and there are still a few pending pull requests. I liked the script > already, but it's getting even cooler ;-). > > A few more random thoughts (not on my personal todo-list): > > * It may make sense to add the short sha1 of the new reference in email > titles (branch foo updated -> branch foo updated to $sha1), so that > gmail users do not get a single huge thread "branch foo updated". > > (Yes, I do know about the Reference field, but gmail uses Subject: for > threading). > [...] I just implemented this in branch sha1s-in-subject [1]. Please let me know if this works for you then I'll merge it to master. (It depends on the header-handling branch, which also includes your patch for non-ASCII header fields.) Michael [1] https://github.com/mhagger/git-multimail/tree/sha1s-in-subject -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- 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 v2] git-multimail: a replacement for post-receive-email
On 02/20/2013 01:28 PM, Matthieu Moy wrote: > Michael Haggerty writes: >> A while ago, I submitted an RFC for adding a new email notification >> script to "contrib" [...] > > We've discussed offline with Michael, a few patches have been merged, > and there are still a few pending pull requests. I liked the script > already, but it's getting even cooler ;-). > > A few more random thoughts (not on my personal todo-list): > > [...] > > * Perhaps we should allow a per-branch configuration, like > > [multimailhook] > mailingList = s...@list.com > [multimailhook "refs/heads/my-branch"] > mailingList = some-ot...@list.com > = > > Branch specific would override value for Config.get(), and > Config.get_all() should probably list both the branch-specific and the > other keys. I wonder whether it would be to far off the beaten path to allow glob patterns in the branch specification; e.g., [multimailhook "refs/heads/release-*"] mailingList = q...@example.com For the case of multiple glob patterns matching a branch name, there would probably have to be a notion of "best match", but that doesn't seem too difficult. The matching would have to take place when looking up individual options to avoid having to replicate the full configuration for each pattern. This feature could also be used to get the functionality of your proposal for skipRefs and onlyRefs [1] in a more general way: [multimailhook] mailingList = s...@example.com [multimailhook "refs/heads/user/$USER/*"] mailingList = "" Michael [1] Proposed feature to allow certain references to be ignored for the purpose of notification emails; see https://github.com/mhagger/git-multimail/pull/15 -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- 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] Improve QNX support in GIT
Hello, > Here is a small patch with QNX build improvements: > > 1) Rename tar.h to tar_git.h. Latest QNX versions have system tar.h > header according to > http://pubs.opengroup.org/onlinepubs/009696699/basedefs/tar.h.html , > to avoid inclusion of another tar.h, original header was renamed. > 2) Rename fnmatch.h to fnmatch_gnu.h and fnmatch.c to fnmatch_gnu.c to > avoid inclusion of system fnmatch.h header in case if -I/usr/include > path is specified before -Icompat/fnmatch. Which is common situation. > 3) pager.c - default "less" invocation flags were changed for QNX 6,x > platform, since QNX has incompatible with GNU coreutils version of > "less" utility. > 4) config.mak.uname - a) do not override mkdtemp/mkstemps/strcasestr > detection, since newer QNX version could contain such functions. Let > to configure decide what is present in the system. b) getpagesize() > function is existing under QNX, c) QNX has pthread functions in the > libc, so do not define NO_PTHREAD macro. Sorry, in the previous post the patch was not inlined. diff --git a/Makefile b/Makefile index ba8e243..f6dd2eb 100644 --- a/Makefile +++ b/Makefile @@ -726,7 +726,7 @@ LIB_H += streaming.h LIB_H += string-list.h LIB_H += submodule.h LIB_H += tag.h -LIB_H += tar.h +LIB_H += tar_git.h LIB_H += thread-utils.h LIB_H += transport.h LIB_H += tree-walk.h @@ -1256,12 +1256,12 @@ endif ifdef NO_FNMATCH COMPAT_CFLAGS += -Icompat/fnmatch COMPAT_CFLAGS += -DNO_FNMATCH - COMPAT_OBJS += compat/fnmatch/fnmatch.o + COMPAT_OBJS += compat/fnmatch/fnmatch_gnu.o else ifdef NO_FNMATCH_CASEFOLD COMPAT_CFLAGS += -Icompat/fnmatch COMPAT_CFLAGS += -DNO_FNMATCH_CASEFOLD - COMPAT_OBJS += compat/fnmatch/fnmatch.o + COMPAT_OBJS += compat/fnmatch/fnmatch_gnu.o endif endif ifdef USE_WILDMATCH diff --git a/archive-tar.c b/archive-tar.c index 719b629..8e24336 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -2,7 +2,7 @@ * Copyright (c) 2005, 2006 Rene Scharfe */ #include "cache.h" -#include "tar.h" +#include "tar_git.h" #include "archive.h" #include "streaming.h" #include "run-command.h" diff --git a/builtin/tar-tree.c b/builtin/tar-tree.c index 3f1e701..b0e4551 100644 --- a/builtin/tar-tree.c +++ b/builtin/tar-tree.c @@ -3,7 +3,7 @@ */ #include "cache.h" #include "commit.h" -#include "tar.h" +#include "tar_git.h" #include "builtin.h" #include "quote.h" diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch_gnu.c similarity index 99% rename from compat/fnmatch/fnmatch.c rename to compat/fnmatch/fnmatch_gnu.c index 5ef0685..f9a5e5b 100644 --- a/compat/fnmatch/fnmatch.c +++ b/compat/fnmatch/fnmatch_gnu.c @@ -26,7 +26,7 @@ #endif #include -#include +#include #include #if HAVE_STRING_H || defined _LIBC diff --git a/compat/fnmatch/fnmatch.h b/compat/fnmatch/fnmatch_gnu.h similarity index 100% rename from compat/fnmatch/fnmatch.h rename to compat/fnmatch/fnmatch_gnu.h diff --git a/config.mak.uname b/config.mak.uname index 8743a6d..2d42ffe 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -527,14 +527,21 @@ ifeq ($(uname_S),QNX) HAVE_STRINGS_H = YesPlease NEEDS_SOCKET = YesPlease NO_FNMATCH_CASEFOLD = YesPlease - NO_GETPAGESIZE = YesPlease NO_ICONV = YesPlease NO_MEMMEM = YesPlease - NO_MKDTEMP = YesPlease - NO_MKSTEMPS = YesPlease NO_NSEC = YesPlease - NO_PTHREADS = YesPlease NO_R_TO_GCC_LINKER = YesPlease - NO_STRCASESTR = YesPlease NO_STRLCPY = YesPlease + # All QNX 6.x versions have pthread functions in libc + # and getpagesize. Leave mkstemps/mkdtemp/strcasestr for + # autodetection. + ifeq ($(shell expr "$(uname_R)" : '6\.[0-9]\.[0-9]'),5) + PTHREAD_LIBS = "" + else + NO_PTHREADS = YesPlease + NO_GETPAGESIZE = YesPlease + NO_STRCASESTR = YesPlease + NO_MKSTEMPS = YesPlease + NO_MKDTEMP = YesPlease + endif endif diff --git a/git-compat-util.h b/git-compat-util.h index b7eaaa9..f59d696 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -113,7 +113,11 @@ #include #include #ifndef USE_WILDMATCH +#if defined(NO_FNMATCH) || defined(NO_FNMATCH_CASEFOLD) +#include +#else #include +#endif /* NO_FNMATCH */ #endif #include #include diff --git a/pager.c b/pager.c index c1ecf65..bed627a 100644 --- a/pager.c +++ b/pager.c @@ -81,7 +81,11 @@ void setup_pager(void) pager_process.argv = pager_argv; pager_process.in = -1; if (!getenv("LESS")) { + #if !defined(__QNXNTO__) static const char *env[] = { "LESS=FRSX", NULL }; + #else + static const char *env[] = { "LESS=rS", NULL }; + #endif /* __QNXNTO__ */ pager_process.env = env; } if (start_command(&pager_process)) diff --git a/tar.h b/tar_git.h similarity index 100% rename from tar.h rename to