* What's cooking in git.git (Aug 2009, #03; Thu, 20) @ 2009-08-21 2:48 Junio C Hamano 2009-08-21 9:10 ` Paolo Bonzini 2009-08-21 12:40 ` Mark A Rada 0 siblings, 2 replies; 10+ messages in thread From: Junio C Hamano @ 2009-08-21 2:48 UTC (permalink / raw) To: git Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. After the 1.6.5 cycle, the next release will be 1.7.0, and we will push out the planned "push safety" change. 1.7.0 would be a good time to introduce "justifiable" changes that are not strictly backward compatible. During 1.6.5 cycle, 'next' will hold topics meant for 1.6.5 and 1.7.0. -------------------------------------------------- [New Topics] * aj/fix-read-tree-from-scratch (2009-08-17) 1 commit (merged to 'next' on 2009-08-20 at 7a04133) + read-tree: Fix regression with creation of a new index file. * as/maint-graph-interesting-fix (2009-08-18) 1 commit. - graph API: fix bug in graph_is_interesting() * jc/1.7.0-status (2009-08-15) 7 commits - git-status: adjust tests - git status: not "commit --dry-run" anymore - git stat -s: short status output - git stat: pathspec limits, unlike traditional "git status" - git stat: show traditional status headers and trailers as well - git stat: honor relative paths setting - git stat: the beginning (this branch uses jc/shortstatus.) * jc/maint-checkout-index-to-prefix (2009-08-16) 1 commit (merged to 'next' on 2009-08-20 at 2f6aea2) + check_path(): allow symlinked directories to checkout-index --prefix * jc/maint-unpack-objects-strict (2009-08-13) 1 commit. - Fix "unpack-objects --strict" * jh/submodule-foreach (2009-08-20) 9 commits (merged to 'next' on 2009-08-20 at 671bea4) + git clone: Add --recursive to automatically checkout (nested) submodules + t7407: Use 'rev-parse --short' rather than bash's substring expansion notation (merged to 'next' on 2009-08-18 at f4a881d) + git submodule status: Add --recursive to recurse into nested submodules + git submodule update: Introduce --recursive to update nested submodules + git submodule foreach: Add --recursive to recurse into nested submodules + git submodule foreach: test access to submodule name as '$name' + Add selftest for 'git submodule foreach' + git submodule: Cleanup usage string and add option parsing to cmd_foreach() + git submodule foreach: Provide access to submodule name, as '$name' * jl/submodule-summary-diff-files (2009-08-15) 2 commits (merged to 'next' on 2009-08-15 at 165bd8e) + Documentaqtion/git-submodule.txt: Typofix (merged to 'next' on 2009-08-14 at a702e78) + git submodule summary: add --files option * lh/short-decorate (2009-08-15) 1 commit (merged to 'next' on 2009-08-18 at b8c1d96) + git-log: allow --decorate[=short|full] * oa/stash-na (2009-08-11) 1 commit (merged to 'next' on 2009-08-14 at 12c2e2b) + git stash: Give friendlier errors when there is nothing to apply * sr/gfi-options (2009-08-13) 3 commits - fast-import: test the new option command - fast-import: add option command - fast-import: put option parsing code in seperate functions -------------------------------------------------- [Graduated to "master"] * bc/maint-am-email (Thu Aug 6 20:08:13 2009 -0500) 2 commits + git-am: print fair error message when format detection fails + am: allow individual e-mail files as input It seems that the "not mbox but a single piece of e-mail" format was something many people relied on. Hopefully this can also be sent to 'maint'. * js/maint-cover-letter-non-ascii (Mon Aug 10 18:22:22 2009 +0200) 2 commits + Correctly mark cover letters' encodings if they are not pure ASCII + Expose the has_non_ascii() function * jk/maint-merge-msg-fix (Sun Aug 9 06:02:51 2009 -0400) 3 commits + merge: indicate remote tracking branches in merge message + merge: fix incorrect merge message for ambiguous tag/branch + add tests for merge message headings * jc/maint-clean-nested-dir-safety (Tue Jun 30 15:33:45 2009 -0700) 1 commit + clean: require double -f options to nuke nested git repository and work tree -------------------------------------------------- [Stalled] * cc/sequencer-rebase-i (2009-08-05) 8 commits. - rebase -i: use "git sequencer--helper --reset-hard" - sequencer: add "--reset-hard" option to "git sequencer--helper" - sequencer: add comments about reset_almost_hard() - sequencer: add "reset_almost_hard()" and related functions - rebase -i: use "git sequencer--helper --make-patch" - sequencer: free memory used in "make_patch" function - sequencer: add "make_patch" function to save a patch - sequencer: add "builtin-sequencer--helper.c" More sequencer updates. I didn't look at the latest round that had a handful "oops, fix that earlier botch" patches, expecting a cleaner reroll (which hasn't happened yet). * pb/tracking (2009-07-16) 7 commits. . branch.c: if remote is not config'd for branch, don't try delete push config . branch, checkout: introduce autosetuppush . move deletion of merge configuration to branch.c . remote: add per-remote autosetupmerge and autosetuprebase configuration . introduce a struct tracking_config . branch: install_branch_config and struct tracking refactoring . config: allow false and true values for branch.autosetuprebase Has been ejected from 'pu' for some time, expecting a reroll. * db/vcs-helper (2009-08-09) 17 commits - Allow helpers to request marks for fast-import - Allow helpers to report in "list" command that the ref is unchanged - Add support for "import" helper command - transport-helper_init(): fix a memory leak in error path - Add a config option for remotes to specify a foreign vcs - Allow programs to not depend on remotes having urls - Allow fetch to modify refs - Use a function to determine whether a remote is valid - Use a clearer style to issue commands to remote helpers (merged to 'next' on 2009-08-07 at f3533ba) + Makefile: install hardlinks for git-remote-<scheme> supported by libcurl if possible + Makefile: do not link three copies of git-remote-* programs + Makefile: git-http-fetch does not need expat (merged to 'next' on 2009-08-06 at 15da79d) + http-fetch: Fix Makefile dependancies + Add transport native helper executables to .gitignore (merged to 'next' on 2009-08-05 at 33d491e) + git-http-fetch: not a builtin + Use an external program to implement fetching with curl + Add support for external programs for handling native fetches (this branch is used by jh/cvs-helper.) There was a discussion that suggests that the use of colon ':' before vcs helper name needs to be corrected. Nothing happened since. * je/send-email-no-subject (2009-08-05) 1 commit - send-email: confirm on empty mail subjects This seems to break t9001. Near the tip of 'pu' I have a iffy workaround. -------------------------------------------------- [Cooking] * ld/p4 (2009-07-30) 1 commit (merged to 'next' on 2009-08-14 at 36d310d) + git-p4: stream from perforce to speed up clones Should graduate to 'master' soon. * mr/gitweb-xz (2009-08-06) 3 commits (merged to 'next' on 2009-08-14 at b63b8e6) + gitweb: add support for XZ compressed snapshots + gitweb: update INSTALL regarding specific snapshot settings + gitweb: support to globally disable a snapshot format Should graduate to 'master' soon. * jh/cvs-helper (2009-08-18) 7 commits - More fixes to the git-remote-cvs installation procedure - Fix the Makefile-generated path to the git_remote_cvs package in git-remote-cvs - Add simple selftests of git-remote-cvs functionality - git-remote-cvs: Remote helper program for CVS repositories - 2/2: Add Python support library for CVS remote helper - 1/2: Add Python support library for CVS remote helper - Basic build infrastructure for Python scripts (this branch uses db/vcs-helper.) Builds on db/vcs-helper. The testing of Python part seemed to be still fragile even with the latest fix on one of my boches with an earlier round already installed, but I didn't look very deeply before removing the older installation. * jc/verify-pack-stat (2009-08-07) 1 commit (merged to 'next' on 2009-08-10 at f80d0e9) + verify-pack --stat-only: show histogram without verifying * lt/block-sha1 (2009-08-17) 4 commits (merged to 'next' on 2009-08-18 at 67a1ce8) + remove ARM and Mozilla SHA1 implementations + block-sha1: guard gcc extensions with __GNUC__ + make sure byte swapping is optimal for git + block-sha1: make the size member first in the context struct Finishing touches ;-) There were a few Solaris portability patches floated around that I didn't pick up, waiting for them to finalize. * nd/sparse (2009-08-11) 8 commits . --sparse for porcelains . Support sparse checkout in unpack_trees() and read-tree . unpack-trees.c: generalize verify_* functions . dir.c: export excluded_1() and add_excludes_from_file_1() . excluded_1(): support exclude "directories" in index . Read .gitignore from index if it is assume-unchanged . Avoid writing to buffer in add_excludes_from_file_1() (merged to 'next' on 2009-08-20 at ea167d7) + Prevent diff machinery from examining assume-unchanged entries on worktree The first one was an independent fix; the rest will be discarded and replaced with the "return of no-checkout" series. * bc/mailsplit-cr-at-eol (2009-08-04) 4 commits (merged to 'next' on 2009-08-06 at 6bc7c5c) + Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings + builtin-mailsplit.c: remove read_line_with_nul() since it is no longer used + builtin-mailinfo,builtin-mailsplit: use strbufs + strbuf: add new function strbuf_getwholeline() Will merge. * gb/apply-ignore-whitespace (2009-08-04) 1 commit (merged to 'next' on 2009-08-06 at 59e2c86) + git apply: option to ignore whitespace differences Will merge. * cc/replace (2009-05-27) 14 commits. (merged to 'next' on 2009-08-02 at b9c4bc0) + t6050: check pushing something based on a replaced commit + Documentation: add documentation for "git replace" + Add git-replace to .gitignore + builtin-replace: use "usage_msg_opt" to give better error messages + parse-options: add new function "usage_msg_opt" + builtin-replace: teach "git replace" to actually replace + Add new "git replace" command + environment: add global variable to disable replacement + mktag: call "check_sha1_signature" with the replacement sha1 + replace_object: add a test case + object: call "check_sha1_signature" with the replacement sha1 + sha1_file: add a "read_sha1_file_repl" function + replace_object: add mechanism to replace objects found in "refs/replace/" + refs: add a "for_each_replace_ref" function Will merge. * jc/1.7.0-diff-whitespace-only-status (2009-05-23) 2 commits. (merged to 'next' on 2009-08-02 at 9c08420) + diff: Rename QUIET internal option to QUICK + diff: change semantics of "ignore whitespace" options For 1.7.0. This changes exit code from "git diff --ignore-whitespace" and friends when there is no actual output. It is a backward incompatible change, but we could argue that it is a bugfix. * jc/1.7.0-push-safety (2009-02-09) 2 commits (merged to 'next' on 2009-08-02 at 38b82fe) + Refuse deleting the current branch via push + Refuse updating the current branch in a non-bare repository via push For 1.7.0. * jn/gitweb-blame (2009-08-06) 3 commits - gitweb: Create links leading to 'blame_incremental' using JavaScript - gitweb: Incremental blame (WIP) - gitweb: Add optional "time to generate page" info in footer * jc/shortstatus (2009-08-15) 11 commits (merged to 'next' on 2009-08-15 at 7e40766) + git commit --dry-run -v: show diff in color when asked + Documentation/git-commit.txt: describe --dry-run (merged to 'next' on 2009-08-12 at 53bda17) + wt-status: collect untracked files in a separate "collect" phase + Make git_status_config() file scope static to builtin-commit.c + wt-status: move wt_status_colors[] into wt_status structure + wt-status: move many global settings to wt_status structure + commit: --dry-run (merged to 'next' on 2009-08-06 at fe8cb94) + status: show worktree status of conflicted paths separately + wt-status.c: rework the way changes to the index and work tree are summarized + diff-index: keep the original index intact + diff-index: report unmerged new entries (this branch is used by jc/1.7.0-status.) Will cook for a bit more and then merge. * jh/notes (2009-07-29) 8 commits. - t3302-notes-index-expensive: Speed up create_repo() - fast-import: Add support for importing commit notes - First draft of notes tree parser with support for fanout subtrees - Teach "-m <msg>" and "-F <file>" to "git notes edit" - Add an expensive test for git-notes - Speed up git notes lookup - Add a script to edit/inspect notes - Introduce commit notes The cvs-helper series depends on this one. * tr/reset-checkout-patch (2009-08-18) 8 commits. (merged to 'next' on 2009-08-18 at e465bb3) + tests: disable interactive hunk selection tests if perl is not available (merged to 'next' on 2009-08-16 at 67896c4) + DWIM 'git stash save -p' for 'git stash -p' + Implement 'git stash save --patch' + Implement 'git checkout --patch' + Implement 'git reset --patch' + builtin-add: refactor the meat of interactive_add() + Add a small patch-mode testing library + git-apply--interactive: Refactor patch mode code (this branch uses js/stash-dwim.) There was a discussion on better DWIMmery to (1) forbid "git stash save --anything-with-dash" and (2) redirect with any option "git stash --opt" to "git stash save --opt", to keep it flexible and safe at the same time. I think it is a sane thing to do. * js/stash-dwim (2009-07-27) 1 commit. (merged to 'next' on 2009-08-16 at 67896c4) + Make 'git stash -k' a short form for 'git stash save --keep-index' (this branch is used by tr/reset-checkout-patch.) * jc/log-tz (2009-03-03) 1 commit. - Allow --date=local --date=other-format to work as expected * jc/mailinfo-remove-brackets (2009-07-15) 1 commit. - mailinfo: -b option keeps [bracketed] strings that is not a [PATCH] marker -------------------------------------------------- [I have been too busy to purge these] * ar/maint-1.6.2-merge-recursive-d-f (2009-05-11) 2 commits. . Fix for a merge where a branch has an F->D transition . Add a reminder test case for a merge with F/D transition * jc/merge-convert (2009-01-26) 1 commit. . git-merge-file: allow converting the results for the work tree * lt/read-directory (2009-05-15) 3 commits. . Add initial support for pathname conversion to UTF-8 . read_directory(): infrastructure for pathname character set conversion . Add 'fill_directory()' helper function for directory traversal * ne/rev-cache (2009-08-17) 6 commits . support for path name caching of blobs/trees in rev-cache . full integration of rev-cache into git's revision walker, completed test suite . administrative functions for rev-cache, and start of integration into git . non-commit object support for rev-cache . bare minimum revision cache system, no integration with git . revision caching documentation: man page and technical discussion * ps/blame (2009-03-12) 1 commit. . blame.c: start libifying the blame infrastructure ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: What's cooking in git.git (Aug 2009, #03; Thu, 20) 2009-08-21 2:48 What's cooking in git.git (Aug 2009, #03; Thu, 20) Junio C Hamano @ 2009-08-21 9:10 ` Paolo Bonzini 2009-08-21 19:36 ` Junio C Hamano 2009-08-21 12:40 ` Mark A Rada 1 sibling, 1 reply; 10+ messages in thread From: Paolo Bonzini @ 2009-08-21 9:10 UTC (permalink / raw) To: Junio C Hamano; +Cc: git On 08/21/2009 04:48 AM, Junio C Hamano wrote: > Has been ejected from 'pu' for some time, expecting a reroll. I've been trying for a while to have push refspecs and tracking working together, but haven't come with anything that I like. I'll let it sleep for a while so that I can look at the problem again with a fresh mind when I come back to it. Paolo ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: What's cooking in git.git (Aug 2009, #03; Thu, 20) 2009-08-21 9:10 ` Paolo Bonzini @ 2009-08-21 19:36 ` Junio C Hamano 0 siblings, 0 replies; 10+ messages in thread From: Junio C Hamano @ 2009-08-21 19:36 UTC (permalink / raw) To: Paolo Bonzini; +Cc: git Paolo Bonzini <bonzini@gnu.org> writes: > On 08/21/2009 04:48 AM, Junio C Hamano wrote: >> Has been ejected from 'pu' for some time, expecting a reroll. > > I've been trying for a while to have push refspecs and tracking > working together, but haven't come with anything that I like. > > I'll let it sleep for a while so that I can look at the problem again > with a fresh mind when I come back to it. Thanks. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: What's cooking in git.git (Aug 2009, #03; Thu, 20) 2009-08-21 2:48 What's cooking in git.git (Aug 2009, #03; Thu, 20) Junio C Hamano 2009-08-21 9:10 ` Paolo Bonzini @ 2009-08-21 12:40 ` Mark A Rada 2009-08-21 18:06 ` Jakub Narebski 2009-08-21 21:43 ` What's cooking in git.git (Aug 2009, #03; Thu, 20) Junio C Hamano 1 sibling, 2 replies; 10+ messages in thread From: Mark A Rada @ 2009-08-21 12:40 UTC (permalink / raw) To: Jakub Narebski; +Cc: git On 20-Aug-09, at 10:48 PM, Junio C Hamano wrote: > Should graduate to 'master' soon. > > * mr/gitweb-xz (2009-08-06) 3 commits > (merged to 'next' on 2009-08-14 at b63b8e6) > + gitweb: add support for XZ compressed snapshots > + gitweb: update INSTALL regarding specific snapshot settings > + gitweb: support to globally disable a snapshot format > I never submitted any tests for the patch that adds global snapshot disabling functionality to gitweb. Jakub, I changed the gitweb_run routine to capture STDOUT as well, is that ok? Unless I missed a case, the tests show that the extra condition check that was added in the &git_snapshot routine is never actually executed, because a disabled snapshot format is not added to @snapshot_fmts, which is checked first. snippet: 5178 } elsif (!grep($_ eq $format, @snapshot_fmts)) { 5179 die_error(403, "Unsupported snapshot format"); 5180 } elsif ($known_snapshot_formats{$format}{'disabled'}) { 5181 die_error(403, "Snapshot format not allowed"); 5182 } 5183 -- Mark A Rada (ferrous26) marada@uwaterloo.ca --- t/t9500-gitweb-standalone-no-errors.sh | 67 +++++++++++++++++++++++ ++++++++- 1 files changed, 66 insertions(+), 1 deletions(-) diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb- standalone-no-errors.sh index 6275181..9ce9667 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -57,10 +57,11 @@ gitweb_run () { # we are interested only in properly formatted errors/warnings rm -f gitweb.log && perl -- "$SCRIPT_NAME" \ - >/dev/null 2>gitweb.log && + >gitweb.output 2>gitweb.log && if grep "^[[]" gitweb.log >/dev/null 2>&1; then false; else true; fi # gitweb.log is left for debugging + # gitweb.output is used to parse output } . ./test-lib.sh @@ -704,4 +705,68 @@ test_expect_success \ gitweb_run "p=.git;a=summary"' test_debug 'cat gitweb.log' + +# ---------------------------------------------------------------------- +# snapshot settings + +cat >>gitweb_config.perl <<EOF + +\$feature{'snapshot'}{'override'} = 0; +EOF + +test_expect_success \ + 'snapshots: tgz only default format enabled' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" && + grep "Status: 200 OK" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" && + grep "403 - Unsupported snapshot format" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" && + grep "403 - Unsupported snapshot format" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" && + grep "403 - Unsupported snapshot format" gitweb.output' +test_debug 'cat gitweb.output' + + +cat >>gitweb_config.perl <<EOF + +\$feature{'snapshot'}{'default'} = ['tgz','tbz2','txz','zip']; +EOF + +test_expect_success \ + 'snapshots: all enabled in default, use default disabled value' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" && + grep "Status: 200 OK" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" && + grep "Status: 200 OK" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" && + grep "403 - Unsupported snapshot format" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" && + grep "Status: 200 OK" gitweb.output' +test_debug 'cat gitweb.output' + + +cat >>gitweb_config.perl <<EOF + +\$known_snapshot_formats{'zip'}{'disabled'} = 1; +EOF + +test_expect_success \ + 'snapshots: zip explicitly disabled' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" && + grep "403 - Unsupported snapshot format" gitweb.output' +test_debug 'cat gitweb.output' + + +cat >>gitweb_config.perl <<EOF + +\$known_snapshot_formats{'tgz'}{'disabled'} = 0; +EOF + +test_expect_success \ + 'snapshots: tgz explicitly enabled' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" && + grep "Status: 200 OK" gitweb.output' +test_debug 'cat gitweb.output' + + test_done -- 1.6.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: What's cooking in git.git (Aug 2009, #03; Thu, 20) 2009-08-21 12:40 ` Mark A Rada @ 2009-08-21 18:06 ` Jakub Narebski 2009-08-21 20:10 ` Junio C Hamano 2009-08-21 21:43 ` What's cooking in git.git (Aug 2009, #03; Thu, 20) Junio C Hamano 1 sibling, 1 reply; 10+ messages in thread From: Jakub Narebski @ 2009-08-21 18:06 UTC (permalink / raw) To: Mark A Rada; +Cc: git, Junio Hamano On Fri, 21 Aug 2009, Mark A Rada wrote: > On 20-Aug-09, at 10:48 PM, Junio C Hamano wrote: > > > Should graduate to 'master' soon. > > > > * mr/gitweb-xz (2009-08-06) 3 commits > > (merged to 'next' on 2009-08-14 at b63b8e6) > > + gitweb: add support for XZ compressed snapshots > > + gitweb: update INSTALL regarding specific snapshot settings > > + gitweb: support to globally disable a snapshot format > > > > > I never submitted any tests for the patch that adds global snapshot > disabling functionality to gitweb. > > Jakub, I changed the gitweb_run routine to capture STDOUT as well, > is that ok? I think it is a good addition to the gitweb tests in git testsuite, as it might make finding cause of an error easier. > Unless I missed a case, the tests show that the extra condition check > that was added in the git_snapshot() routine is never actually > executed, because a disabled snapshot format is not added to > @snapshot_fmts, which is checked first. > > snippet: > 5178 } elsif (!grep($_ eq $format, @snapshot_fmts)) { > 5179 die_error(403, "Unsupported snapshot format"); > 5180 } elsif ($known_snapshot_formats{$format}{'disabled'}) { > 5181 die_error(403, "Snapshot format not allowed"); > 5182 } > 5183 So we did check if format is disable twice, once when creating (generating @snapshot_fmts list, and once (I guess unnecessary; @snapshot_fmts is generated after reading GITWEB_CONFIG file(s)) when checking if snapshot $format is on the list of possible (allowed) formats in the snipped above. Am I right? If it is so, the last part of above snipped wouldn't be ever exercised, and is not necessary. > --- > t/t9500-gitweb-standalone-no-errors.sh | 67 +++++++++++++++++++++++ > ++++++++- Word-wrapped. > 1 files changed, 66 insertions(+), 1 deletions(-) > > diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb- > standalone-no-errors.sh > index 6275181..9ce9667 100755 > --- a/t/t9500-gitweb-standalone-no-errors.sh > +++ b/t/t9500-gitweb-standalone-no-errors.sh > @@ -57,10 +57,11 @@ gitweb_run () { > # we are interested only in properly formatted errors/warnings > rm -f gitweb.log && > perl -- "$SCRIPT_NAME" \ > - >/dev/null 2>gitweb.log && > + >gitweb.output 2>gitweb.log && > if grep "^[[]" gitweb.log >/dev/null 2>&1; then false; else true; fi > > # gitweb.log is left for debugging > + # gitweb.output is used to parse output > } This is a good change. > > . ./test-lib.sh > @@ -704,4 +705,68 @@ test_expect_success \ > gitweb_run "p=.git;a=summary"' > test_debug 'cat gitweb.log' > > + > +# > ---------------------------------------------------------------------- > +# snapshot settings > + > +cat >>gitweb_config.perl <<EOF > + > +\$feature{'snapshot'}{'override'} = 0; > +EOF A trick: use '\EOF' and you don't need to escape $ against variable expansion by shell. +cat >>gitweb_config.perl <<\EOF + +$feature{'snapshot'}{'override'} = 0; +EOF > + > +test_expect_success \ > + 'snapshots: tgz only default format enabled' \ > + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" && > + grep "Status: 200 OK" gitweb.output && > + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" && > + grep "403 - Unsupported snapshot format" gitweb.output && > + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" && > + grep "403 - Unsupported snapshot format" gitweb.output && > + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" && > + grep "403 - Unsupported snapshot format" gitweb.output' > +test_debug 'cat gitweb.output' I would prefer (but I do not require) that such test were placed in separate file, named e.g. t9501-gitweb-check-http-status.sh, and leave t9500-gitweb-standalone-no-errors.sh to be about checking for Perl errors and warnings only. This would require to extract common infrastructure (gitweb_init, gitweb_run, checking prerequisites) into t/lib-gitweb.sh (or t/gitweb-lib.sh ;-)). -- Jakub Narebski Poland ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: What's cooking in git.git (Aug 2009, #03; Thu, 20) 2009-08-21 18:06 ` Jakub Narebski @ 2009-08-21 20:10 ` Junio C Hamano 2009-08-22 22:42 ` [RFC] gitweb.perl t9500 t9501 Mark A Rada 0 siblings, 1 reply; 10+ messages in thread From: Junio C Hamano @ 2009-08-21 20:10 UTC (permalink / raw) To: Jakub Narebski; +Cc: Mark A Rada, git Jakub Narebski <jnareb@gmail.com> writes: >> +cat >>gitweb_config.perl <<EOF >> + >> +\$feature{'snapshot'}{'override'} = 0; >> +EOF > > A trick: use '\EOF' and you don't need to escape $ against variable > expansion by shell. > > +cat >>gitweb_config.perl <<\EOF > + > +$feature{'snapshot'}{'override'} = 0; > +EOF It is not a "trick" but is a basic courtesy for reviewers. Even if you do not have any $ to worry about, _unless_ you actively know you would want variable substitution to happen, it is easier for readers if you signal the fact that the here-doc is verbatim by quoting the \EOF marker upfront. Same thing for use of single quotes vs double quotes when writing strings, even though they tend to be small and much less of an issue. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [RFC] gitweb.perl t9500 t9501 2009-08-21 20:10 ` Junio C Hamano @ 2009-08-22 22:42 ` Mark A Rada 2009-08-23 2:09 ` Junio C Hamano 0 siblings, 1 reply; 10+ messages in thread From: Mark A Rada @ 2009-08-22 22:42 UTC (permalink / raw) To: Jakub Narebski, Junio C Hamano; +Cc: git Ok, I have a few questions, please: > Word-wrapped. I have not been telling git-format-patch to use a specific width for the diffstat, is the standard width supposed to be 70? Also, you will note a line in the patch below that will definitely be broken, it looks like diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb- standalone-no-errors.sh I don't see an option for git-format-patch to get around that in the man page, how would I fix that? > I do not mind keeping these two lines as belt-and-suspender, though. That is a vivid analogy...I will have to remember that one for later. I tried switching the order of the last two checks, and I think it makes that unused check more useful, it can inform clients they are trying something that has been explicitly disabled as opposed to just notifying them the format is unsupported. Do you think making the change is worthwhile? (new commit? rewinding?) (The patch at the bottom currently assumes you have switched them already.) another snippet: @@ -5175,10 +5175,10 @@ sub git_snapshot { die_error(400, "Invalid snapshot format parameter"); } elsif (!exists($known_snapshot_formats{$format})) { die_error(400, "Unknown snapshot format"); - } elsif (!grep($_ eq $format, @snapshot_fmts)) { - die_error(403, "Unsupported snapshot format"); } elsif ($known_snapshot_formats{$format}{'disabled'}) { die_error(403, "Snapshot format not allowed"); + } elsif (!grep($_ eq $format, @snapshot_fmts)) { + die_error(403, "Unsupported snapshot format"); } if (!defined $hash) { >> A trick: use '\EOF' and you don't need to escape $ against variable >> expansion by shell. > It is not a "trick" but is a basic courtesy for reviewers. Even if > you do > not have any $ to worry about, _unless_ you actively know you would > want > variable substitution to happen, it is easier for readers if you > signal > the fact that the here-doc is verbatim by quoting the \EOF marker > upfront. Thanks for the protip, I've taken the liberty of making use of it for gitweb-lib.sh, I hope you don't mind, Jakub. -- Mark A Rada (ferrous26) marada@uwaterloo.ca --- t/gitweb-lib.sh | 74 +++++++++++++++++++ t/t9500-gitweb-standalone-no-errors.sh | 68 +----------------- t/t9501-gitweb-standalone-http-status.sh | 78 ++++++++++++++++++++ 3 files changed, 153 insertions(+), 67 deletions(-) diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh new file mode 100644 index 0000000..4f4115f --- /dev/null +++ b/t/gitweb-lib.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# +# Copyright (c) 2007 Jakub Narebski +# + + +gitweb_init () { + safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')" + cat >gitweb_config.perl <<EOF +#!/usr/bin/perl + +# gitweb configuration for tests + +our \$version = 'current'; +our \$GIT = 'git'; +our \$projectroot = "$safe_pwd"; +our \$project_maxdepth = 8; +our \$home_link_str = 'projects'; +our \$site_name = '[localhost]'; +our \$site_header = ''; +our \$site_footer = ''; +our \$home_text = 'indextext.html'; +our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/gitweb.css'); +our \$logo = 'file:///$TEST_DIRECTORY/../gitweb/git-logo.png'; +our \$favicon = 'file:///$TEST_DIRECTORY/../gitweb/git-favicon.png'; +our \$projects_list = ''; +our \$export_ok = ''; +our \$strict_export = ''; + +EOF + + cat >.git/description <<EOF +$0 test repository +EOF +} + +gitweb_run () { + GATEWAY_INTERFACE='CGI/1.1' + HTTP_ACCEPT='*/*' + REQUEST_METHOD='GET' + SCRIPT_NAME="$TEST_DIRECTORY/../gitweb/gitweb.perl" + QUERY_STRING=""$1"" + PATH_INFO=""$2"" + export GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \ + SCRIPT_NAME QUERY_STRING PATH_INFO + + GITWEB_CONFIG=$(pwd)/gitweb_config.perl + export GITWEB_CONFIG + + # some of git commands write to STDERR on error, but this is not + # written to web server logs, so we are not interested in that: + # we are interested only in properly formatted errors/warnings + rm -f gitweb.log && + perl -- "$SCRIPT_NAME" \ + >gitweb.output 2>gitweb.log && + if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi + + # gitweb.log is left for debugging + # gitweb.output is used to parse http output +} + +. ./test-lib.sh + +if ! test_have_prereq PERL; then + say 'skipping gitweb tests, perl not available' + test_done +fi + +perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || { + say 'skipping gitweb tests, perl version is too old' + test_done +} + +gitweb_init diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb- standalone-no-errors.sh index 6275181..32e47d3 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -9,73 +9,7 @@ This test runs gitweb (git web interface) as CGI script from commandline, and checks that it would not write any errors or warnings to log.' -gitweb_init () { - safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')" - cat >gitweb_config.perl <<EOF -#!/usr/bin/perl - -# gitweb configuration for tests - -our \$version = "current"; -our \$GIT = "git"; -our \$projectroot = "$safe_pwd"; -our \$project_maxdepth = 8; -our \$home_link_str = "projects"; -our \$site_name = "[localhost]"; -our \$site_header = ""; -our \$site_footer = ""; -our \$home_text = "indextext.html"; -our @stylesheets = ("file:///$TEST_DIRECTORY/../gitweb/gitweb.css"); -our \$logo = "file:///$TEST_DIRECTORY/../gitweb/git-logo.png"; -our \$favicon = "file:///$TEST_DIRECTORY/../gitweb/git-favicon.png"; -our \$projects_list = ""; -our \$export_ok = ""; -our \$strict_export = ""; - -EOF - - cat >.git/description <<EOF -$0 test repository -EOF -} - -gitweb_run () { - GATEWAY_INTERFACE="CGI/1.1" - HTTP_ACCEPT="*/*" - REQUEST_METHOD="GET" - SCRIPT_NAME="$TEST_DIRECTORY/../gitweb/gitweb.perl" - QUERY_STRING=""$1"" - PATH_INFO=""$2"" - export GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \ - SCRIPT_NAME QUERY_STRING PATH_INFO - - GITWEB_CONFIG=$(pwd)/gitweb_config.perl - export GITWEB_CONFIG - - # some of git commands write to STDERR on error, but this is not - # written to web server logs, so we are not interested in that: - # we are interested only in properly formatted errors/warnings - rm -f gitweb.log && - perl -- "$SCRIPT_NAME" \ - >/dev/null 2>gitweb.log && - if grep "^[[]" gitweb.log >/dev/null 2>&1; then false; else true; fi - - # gitweb.log is left for debugging -} - -. ./test-lib.sh - -if ! test_have_prereq PERL; then - say 'skipping gitweb tests, perl not available' - test_done -fi - -perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || { - say 'skipping gitweb tests, perl version is too old' - test_done -} - -gitweb_init +. ./gitweb-lib.sh # ---------------------------------------------------------------------- # no commits (empty, just initialized repository) diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb- standalone-http-status.sh new file mode 100644 index 0000000..be042f0 --- /dev/null +++ b/t/t9501-gitweb-standalone-http-status.sh @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Copyright (c) 2009 Mark Rada +# + + +test_description='gitweb as standalone script (http status tests). + +This test runs gitweb (git web interface) as CGI script from the +commandline, and checks that it returns the appropriate http status +code and message.' + +. ./gitweb-lib.sh + +# ---------------------------------------------------------------------- +# snapshot settings + +test_commit \ + 'GITWEB' \ + 'I CAN HAS SNAPSHOT?' + +cat >>gitweb_config.perl <<\EOF +$feature{'snapshot'}{'override'} = 0; +EOF + +test_expect_success \ + 'snapshots: tgz only default format enabled' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" && + grep "Status: 200 OK" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" && + grep "403 - Unsupported snapshot format" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" && + grep "403 - Snapshot format not allowed" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" && + grep "403 - Unsupported snapshot format" gitweb.output' +test_debug 'cat gitweb.output' + + +cat >>gitweb_config.perl <<\EOF +$feature{'snapshot'}{'default'} = ['tgz','tbz2','txz','zip']; +EOF + +test_expect_success \ + 'snapshots: all enabled in default, use default disabled value' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" && + grep "Status: 200 OK" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" && + grep "Status: 200 OK" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" && + grep "403 - Snapshot format not allowed" gitweb.output && + gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" && + grep "Status: 200 OK" gitweb.output' +test_debug 'cat gitweb.output' + + +cat >>gitweb_config.perl <<\EOF +$known_snapshot_formats{'zip'}{'disabled'} = 1; +EOF + +test_expect_success \ + 'snapshots: zip explicitly disabled' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" && + grep "403 - Snapshot format not allowed" gitweb.output' +test_debug 'cat gitweb.output' + + +cat >>gitweb_config.perl <<\EOF +$known_snapshot_formats{'tgz'}{'disabled'} = 0; +EOF + +test_expect_success \ + 'snapshots: tgz explicitly enabled' \ + 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" && + grep "Status: 200 OK" gitweb.output' +test_debug 'cat gitweb.output' + + +test_done -- 1.6.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC] gitweb.perl t9500 t9501 2009-08-22 22:42 ` [RFC] gitweb.perl t9500 t9501 Mark A Rada @ 2009-08-23 2:09 ` Junio C Hamano 2009-08-23 15:29 ` Mark A Rada 0 siblings, 1 reply; 10+ messages in thread From: Junio C Hamano @ 2009-08-23 2:09 UTC (permalink / raw) To: Mark A Rada; +Cc: Jakub Narebski, git Mark A Rada <marada@uwaterloo.ca> writes: > I have not been telling git-format-patch to use a specific width for > the diffstat, is the standard width supposed to be 70? Perhaps there is some misconception here. We try to keep our _code_ to fit in standard 80-column terminal. We also keep lines in the _log message_ shorter than 70-something so that after indentation by various programs (e.g. shortlog) and a few levels of quoting in the e-mail are added, the lines will still stay below 80-columns. These are standard practices. And you may need to find a good place to break lines in your _code_, and your _log message_, to stay below that limit. But that all happens inside your editor, before you touch format-patch nor your MUA. The patch contents may contain long lines, such as diff --git a/filename-that-is-long b/filename-that-is-long or @@ -old,lines +new,lines @@ original contents that is long that is neither _code_ nor _log message_. They could easily go beyond 80-column, but that is normal, and they do not have any 70-column limit for you to worry about. They follow a different rule, namely, if format-patch (or "diff" in general) outputs something on a single line, that has to stay on a single line. "patch" expects each of these on a single line. Do not break them. So make sure that you do not let your MUA perform any line-wrapping at random place in the message after you formatted your commits via format-patch, and you will be Ok. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] gitweb.perl t9500 t9501 2009-08-23 2:09 ` Junio C Hamano @ 2009-08-23 15:29 ` Mark A Rada 0 siblings, 0 replies; 10+ messages in thread From: Mark A Rada @ 2009-08-23 15:29 UTC (permalink / raw) To: Junio C Hamano; +Cc: Jakub Narebski, git On 22-Aug-09, at 10:09 PM, Junio C Hamano wrote: > Mark A Rada <marada@uwaterloo.ca> writes: > >> I have not been telling git-format-patch to use a specific width for >> the diffstat, is the standard width supposed to be 70? > > Perhaps there is some misconception here. > Yup, my bad, told my MUA to send as text/plain, but it didn't, so I was seeing perfectly fine e-mails when I received them, but gmane showed me how mangled everything was. I'll find a better MUA and resend later, thanks for your patience with me. -- Mark A Rada (ferrous26) marada@uwaterloo.ca ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: What's cooking in git.git (Aug 2009, #03; Thu, 20) 2009-08-21 12:40 ` Mark A Rada 2009-08-21 18:06 ` Jakub Narebski @ 2009-08-21 21:43 ` Junio C Hamano 1 sibling, 0 replies; 10+ messages in thread From: Junio C Hamano @ 2009-08-21 21:43 UTC (permalink / raw) To: Mark A Rada; +Cc: Jakub Narebski, git Mark A Rada <marada@uwaterloo.ca> writes: > Unless I missed a case, the tests show that the extra condition check > that was added in the &git_snapshot routine is never actually executed, > because a disabled snapshot format is not added to @snapshot_fmts, which > is checked first. > > snippet: > 5178 } elsif (!grep($_ eq $format, @snapshot_fmts)) { > 5179 die_error(403, "Unsupported snapshot format"); > 5180 } elsif ($known_snapshot_formats{$format}{'disabled'}) { > 5181 die_error(403, "Snapshot format not allowed"); > 5182 } > 5183 True; filter_snapshot_fmts looks at 'disabled' first. I do not mind keeping these two lines as belt-and-suspender, though. ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-08-23 15:30 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-08-21 2:48 What's cooking in git.git (Aug 2009, #03; Thu, 20) Junio C Hamano 2009-08-21 9:10 ` Paolo Bonzini 2009-08-21 19:36 ` Junio C Hamano 2009-08-21 12:40 ` Mark A Rada 2009-08-21 18:06 ` Jakub Narebski 2009-08-21 20:10 ` Junio C Hamano 2009-08-22 22:42 ` [RFC] gitweb.perl t9500 t9501 Mark A Rada 2009-08-23 2:09 ` Junio C Hamano 2009-08-23 15:29 ` Mark A Rada 2009-08-21 21:43 ` What's cooking in git.git (Aug 2009, #03; Thu, 20) Junio C Hamano
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.