From: Junio C Hamano <hidden> Date: 2016-06-15 22:49:18
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.
Has the rate of patch traffic increased markedly for the past few months?
I am feeling perpetually behind these days...
--------------------------------------------------
[New Topics]
* ab/omit-aggregate-test-result-under-tap-harness (2010-08-11) 1 commit
- test-lib: Don't write test-results when HARNESS_ACTIVE
* ab/test-prereq (2010-08-11) 5 commits
- test-lib: Multi-prereq support only checked the last prereq
- tests: A SANITY test prereq for testing if we're root
- t/README: Document the predefined test prerequisites
- test-lib: Print missing prerequisites in test output
- test-lib: Add support for multiple test prerequisites
* ab/test-smoke (2010-08-08) 4 commits
- t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target
- t/Makefile: Can't include GIT-BUILD-OPTIONS, it's a .sh
- t/README: Document the Smoke testing
- tests: Infrastructure for Git smoke testing
Will merge the above three topics to 'next' together with other "test"
topics from the same author shortly.
* by/line-log (2010-08-11) 18 commits
- line-log: minimum compilation fix
- Document line history browser
- Add tests for line history browser
- Add --full-line-diff option
- Add --graph prefix before line history output
- Add parent rewriting to line history browser
- Make graph_next_line external to other part of git
- Make rewrite_parents public to other part of git
- Hook line history into cmd_log, ensuring a topo-ordered walk
- Print the line log
- map/take range to the parent of commits
- Add range clone functions
- Export three functions from diff.c
- Parse the -L options
- Refactor parse_loc
- Add the basic data structure for line level history
- parse-options: add two helper functions
- parse-options: enhance STOP_AT_NON_OPTION
Does not seem to pass the self test for me...
* dg/local-mod-error-messages (2010-08-11) 5 commits
- t7609: test merge and checkout error messages
- unpack_trees: group error messages by type
- merge-recursive: distinguish "removed" and "overwritten" messages
- merge-recursive: porcelain messages for checkout
- Turn unpack_trees_options.msgs into an array + enum
Looking good.
* en/rebase-against-rebase-fix (2010-08-06) 2 commits
- pull --rebase: Avoid spurious conflicts and reapplying unnecessary patches
- t5520-pull: Add testcases showing spurious conflicts from git pull --rebase
* gb/split-cmdline-errmsg (2010-08-07) 1 commit
- split_cmdline: Allow caller to access error string
* jc/builtin-binsearch (2010-08-05) 2 commits
. git.c: binary search in the built-in command list
. git.c: sort the list of built-in command names
* jl/submodule-ignore-diff (2010-08-06) 4 commits
- Add tests for the diff.ignoreSubmodules config option
- Add the 'diff.ignoreSubmodules' config setting
- Submodules: Use "ignore" settings from .gitmodules too for diff and status
- Submodules: Add the new "ignore" config option for diff and status
Looking good.
* jn/commit-no-change-wo-status (2010-07-24) 9 commits
. commit: suppress status summary when no changes staged
. commit --dry-run: give advice on empty amend
. commit: give empty-commit avoidance code its own function
. t7508 (status): modernize style
. commit: split off the piece that writes status
. commit: split commit -s handling into its own function
. commit: split off a function to fetch the default log message
. wt-status: split off a function for printing submodule summary
. wt-status: split wt_status_print into digestible pieces
* jn/merge-renormalize (2010-08-05) 12 commits
. merge-recursive --renormalize
. rerere: never renormalize
. rerere: migrate to parse-options API
. t4200 (rerere): modernize style
. ll-merge: let caller decide whether to renormalize
. ll-merge: make flag easier to populate
. Documentation/technical: document ll_merge
. merge-trees: let caller decide whether to renormalize
. merge-trees: push choice to renormalize away from low level
. t6038 (merge.renormalize): check that it can be turned off
. t6038 (merge.renormalize): try checkout -m and cherry-pick
. t6038 (merge.renormalize): style nitpicks
(this branch uses eb/double-convert-before-merge.)
* jn/paginate-fix (2010-08-05) 13 commits
. merge-file: run setup_git_directory_gently() sooner
. var: run setup_git_directory_gently() sooner
. ls-remote: run setup_git_directory_gently() sooner
. index-pack: run setup_git_directory_gently() sooner
. Merge branch 'jn/maint-setup-fix' (early part) into HEAD
. config: run setup_git_directory_gently() sooner
. bundle: run setup_git_directory_gently() sooner
. apply: run setup_git_directory_gently() sooner
. grep: run setup_git_directory_gently() sooner
. shortlog: run setup_git_directory_gently() sooner
. git wrapper: allow setup_git_directory_gently() be called earlier
. setup: remember whether repository was found
. git wrapper: introduce startup_info struct
(this branch uses jn/maint-setup-fix.)
I had trouble merging these three topics to 'pu' and ran out of time my
git Wednesday this week. I think the "no-change-wo-status" one had some
unintended consequences discovered on the list?
* jn/maint-plug-leak (2010-08-09) 3 commits
- write-tree: Avoid leak when index refers to an invalid object
- read-tree: stop leaking tree objects
- core: Stop leaking ondisk_cache_entrys
Will fast-track merging to 'next', 'master' and 'maint' after giving it
another look.
* jn/svn-fe (2010-08-09) 10 commits
- svn-fe manual: Clarify warning about deltas in dump files
- Update svn-fe manual
- SVN dump parser
- Infrastructure to write revisions in fast-export format
- Add stream helper library
- Add string-specific memory pool
- Add treap implementation
- Add memory pool library
- Introduce vcs-svn lib
- Export parse_date_basic() to convert a date string to timestamp
There was a screw-up on my part---I should have dropped the first one and
branched this off of jn/parse-date-basic (I'll fix it up before merging
this to 'next').
* js/detached-stash (2010-08-10) 9 commits
- Documentation: git stash branch now tolerates non-stash references.
- t3903-stash.sh: tests of git stash with stash-like arguments
- stash: teach git stash show to always tolerate stash-like arguments.
- stash: teach git stash branch to tolerate stash-like arguments
- stash: teach git stash drop to fail early if the specified revision is not a stash reference
- stash: teach git stash pop to fail early if the argument is not a stash ref
- stash: introduce is_stash_ref and assert_stash_ref functions.
- stash: extract stash-like check into its own function
- stash: refactor - create pop_stash function
Haven't looked this new round closely yet.
* mm/rebase-i-exec (2010-08-10) 2 commits
- test-lib: user-friendly alternatives to test [-d|-f|-e]
- rebase -i: add exec command to launch a shell command
Looking good.
* so/http-user-agent (2010-08-11) 1 commit
- Allow HTTP user agent string to be modified.
Looking good.
* sp/fix-smart-http-deadlock-on-error (2010-08-06) 1 commit
(merged to 'next' on 2010-08-11 at 0a6369e)
+ smart-http: Don't deadlock on server failure
Will fast-track merging to 'master' and 'maint' after giving it another
look.
--------------------------------------------------
[Ejected]
* rr/svn-export (2010-07-29) 9 commits
. vcs-svn: Remove stray calls to removed functions
. Add SVN dump parser
. Add infrastructure to write revisions in fast-export format
. Add stream helper library
. Add string-specific memory pool
. vcs-svn: treap_search should return NULL for missing items
. Add treap implementation
. Add memory pool library
. Introduce vcs-svn lib
(this branch uses jn/parse-date-basic.)
Replaced with Jonathan's reroll.
--------------------------------------------------
[Stalled]
* zl/mailinfo-recode-patch (2010-06-14) 2 commits
- add --recode-patch option to git-am
- add --recode-patch option to git-mailinfo
I recall there was another round of re-roll planned for this one.
* jk/tag-contains (2010-07-05) 4 commits
- Why is "git tag --contains" so slow?
- default core.clockskew variable to one day
- limit "contains" traversals based on commit timestamp
- tag: speed up --contains calculation
--------------------------------------------------
[Cooking]
* jc/sha1-name-find-fix (2010-08-02) 1 commit
(merged to 'next' on 2010-08-11 at 51106a5)
+ sha1_name.c: fix parsing of ":/token" syntax
Will merge to 'master' (and perhaps 'maint').
* jn/doc-pull (2010-08-02) 1 commit
(merged to 'next' on 2010-08-11 at a223479)
+ Documentation: flesh out “git pull” description
Will merge to 'master'.
* jn/maint-gitweb-dynconf (2010-07-30) 1 commit
(merged to 'next' on 2010-08-11 at a94ce85)
+ gitweb: allow configurations that change with each request
Will merge to 'master'.
* sr/local-config (2010-08-03) 1 commit
- config: add --local option
Looked Ok. Will merge to 'next'.
* ab/test-coverage (2010-07-26) 8 commits
- Makefile: make gcov invocation configurable
- t/README: Add a note about the dangers of coverage chasing
- t/README: A new section about test coverage
- Makefile: Add cover_db_html target
- Makefile: Add cover_db target
- Makefile: Split out the untested functions target
- Makefile: Include subdirectories in "make cover" reports
- gitignore: Ignore files generated by "make coverage"
* ab/test-no-skip (2010-08-10) 13 commits
- git-notes: Run partial expensive test everywhere
- t/t3300-funny-names: change from skip_all=* to prereq skip
- t/t3902-quoted: change from skip_all=* to prereq skip
- t/t4016-diff-quote: change from skip_all=* to prereq skip
- t/t5503-tagfollow: change from skip_all=* to prereq skip
- t/t7005-editor: change from skip_all=* to prereq skip
- t/t5705-clone-2gb: change from skip_all=* to prereq skip
- t/t1304-default-acl: change from skip_all=* to prereq skip
- t/README: Update "Skipping tests" to align with best practices
- t/t7800-difftool.sh: Skip with prereq on no PERL
- t/t5800-remote-helpers.sh: Skip with prereq on python <2.4
- t/t4004-diff-rename-symlink.sh: use three-arg <prereq>
- tests: implicitly skip SYMLINKS tests using <prereq>
* bc/use-more-hardlinks-in-install (2010-07-23) 2 commits
(merged to 'next' on 2010-08-11 at 59dd30e)
+ Makefile: make hard/symbolic links for non-builtins too
+ Makefile: link builtins residing in bin directory to main git binary too
Will merge to 'master'.
* cc/find-commit-subject (2010-07-22) 6 commits
- blame: use find_commit_subject() instead of custom code
- merge-recursive: use find_commit_subject() instead of custom code
- bisect: use find_commit_subject() instead of custom code
- revert: rename variables related to subject in get_message()
- revert: refactor code to find commit subject in find_commit_subject()
- revert: fix off by one read when searching the end of a commit subject
Looked Ok. Will merge to 'next'.
* gb/shell-ext (2010-07-28) 3 commits
- Add sample commands for git-shell
- Add interactive mode to git-shell for user-friendliness
- Allow creation of arbitrary git-shell commands
* jc/log-grep (2010-07-19) 1 commit
- git log: add -G<regexp> that greps in the patch text
This is broken, but haven't found any time to revisit it yet.
* jh/clean-exclude (2010-07-20) 2 commits
- Add test for git clean -e.
- Add -e/--exclude to git-clean.
Looked Ok. Will merge to 'next'.
* jh/use-test-must-fail (2010-07-20) 1 commit
- Convert "! git" to "test_must_fail git"
Looked Ok. Will merge to 'next'.
* jn/apply-filename-with-sp (2010-07-23) 4 commits
- apply: Handle traditional patches with space in filename
- t4135 (apply): use expand instead of pr for portability
- tests: Test how well "git apply" copes with weird filenames
- apply: Split quoted filename handling into new function
Looked Ok. Will merge to 'next'.
* jn/fix-abbrev (2010-07-27) 3 commits
- examples/commit: use --abbrev for commit summary
- checkout, commit: remove confusing assignments to rev.abbrev
- archive: abbreviate substituted commit ids again
Looked Ok. Will merge to 'next'.
* jn/maint-setup-fix (2010-07-24) 11 commits
- setup: split off a function to handle ordinary .git directories
- Revert "rehabilitate 'git index-pack' inside the object store"
- setup: do not forget working dir from subdir of gitdir
- t4111 (apply): refresh index before applying patches to it
- setup: split off get_device_or_die helper
- setup: split off a function to handle hitting ceiling in repo search
- setup: split off code to handle stumbling upon a repository
- setup: split off a function to checks working dir for .git file
- setup: split off $GIT_DIR-set case from setup_git_directory_gently
- tests: try git apply from subdir of toplevel
- t1501 (rev-parse): clarify
(this branch is used by jn/paginate-fix.)
* jn/rebase-rename-am (2008-11-10) 5 commits
- rebase: protect against diff.renames configuration
- t3400 (rebase): whitespace cleanup
- Teach "apply --index-info" to handle rename patches
- t4150 (am): futureproof against failing tests
- t4150 (am): style fix
Will merge to 'next'.
* ml/rebase-x-strategy (2010-07-29) 1 commit
- rebase: support -X to pass through strategy options
Looked Ok. Will merge to 'next'.
* mm/shortopt-detached (2010-08-05) 5 commits
- log: parse separate option for --glob
- log: parse separate options like git log --grep foo
- diff: parse separate options --stat-width n, --stat-name-width n
- diff: split off a function for --stat-* option parsing
- diff: parse separate options like -S foo
Looked Ok. Will merge to 'next'.
* nd/fix-sparse-checkout (2010-07-31) 5 commits
- unpack-trees: mark new entries skip-worktree appropriately
- unpack-trees: do not check for conflict entries too early
- unpack-trees: let read-tree -u remove index entries outside sparse area
- unpack-trees: only clear CE_UPDATE|CE_REMOVE when skip-worktree is always set
- t1011 (sparse checkout): style nitpicks
Looked Ok. Will merge to 'next'.
* tr/ab-i18n-fix (2010-07-25) 1 commit
- tests: locate i18n lib&data correctly under --valgrind
(this branch uses ab/i18n.)
Looked Ok. Will merge to 'next'.
* tr/maint-no-unquote-plus (2010-07-24) 1 commit
- Do not unquote + into ' ' in URLs
* tr/xsize-bits (2010-07-28) 1 commit
(merged to 'next' on 2010-08-11 at bcc0271)
+ xsize_t: check whether we lose bits
* vs/doc-spell (2010-07-20) 1 commit
- Documentation: spelling fixes
Looked Ok. Will merge to 'next'.
* ab/report-corrupt-object-with-type (2010-06-10) 1 commit
- sha1_file: Show the the type and path to corrupt objects
Looked Ok. Will merge to 'next'.
* cc/revert (2010-07-21) 5 commits
- t3508: add check_head_differs_from() helper function and use it
- revert: improve success message by adding abbreviated commit sha1
- revert: don't print "Finished one cherry-pick." if commit failed
- revert: refactor commit code into a new run_git_commit() function
- revert: report success when using option --strategy
* en/fast-export-fix (2010-07-17) 2 commits
- fast-export: Add a --full-tree option
- fast-export: Fix dropping of files with --import-marks and path limiting
* jn/parse-date-basic (2010-07-15) 1 commit
(merged to 'next' on 2010-08-11 at ca9fef0)
+ Export parse_date_basic() to convert a date string to timestamp
(this branch is used by rr/svn-export.)
Will merge to 'master'.
* kf/post-receive-sample-hook (2010-07-16) 1 commit
- post-receive-email: optional message line count limit
I do not particularly like the idea of counting number of lines in a shell
loop but this is an opt-in feature to a contrib/ item so it should be ok.
Will merge to 'next'.
* tr/rfc-reset-doc (2010-07-18) 5 commits
(merged to 'next' on 2010-08-11 at 8e7c8d1)
+ Documentation/reset: move "undo permanently" example behind "make topic"
+ Documentation/reset: reorder examples to match description
+ Documentation/reset: promote 'examples' one section up
+ Documentation/reset: separate options by mode
+ Documentation/git-reset: reorder modes for soft-mixed-hard progression
Looked fine. Will merge to 'master'.
* hv/autosquash-config (2010-07-14) 1 commit
- add configuration variable for --autosquash option of interactive rebase
* jh/graph-next-line (2010-07-13) 2 commits
(merged to 'next' on 2010-08-11 at 333f9df)
+ Enable custom schemes for column colors in the graph API
+ Make graph_next_line() available in the graph.h API
* ar/string-list-foreach (2010-07-03) 2 commits
(merged to 'next' on 2010-08-11 at 993dc02)
+ Convert the users of for_each_string_list to for_each_string_list_item macro
+ Add a for_each_string_list_item macro
(this branch is used by tf/string-list-init.)
* il/rfc-remote-fd-ext (2010-07-31) 4 commits
- Rewrite bidirectional traffic loop
- gitignore: Ignore the new /git-remote-{ext,fd} helpers
- New remote helper: git-remote-ext
- New remote helper git-remote-fd
* hv/submodule-find-ff-merge (2010-07-07) 3 commits
(merged to 'next' on 2010-08-11 at 6900d2c)
+ Implement automatic fast-forward merge for submodules
+ setup_revisions(): Allow walking history in a submodule
+ Teach ref iteration module about submodules
* jn/fast-import-subtree (2010-06-30) 1 commit
(merged to 'next' on 2010-08-11 at 5e19de0)
+ Teach fast-import to import subtrees named by tree id
* sg/rerere-gc-old-still-used (2010-07-13) 2 commits
- rerere: fix overeager gc
- mingw_utime(): handle NULL times parameter
* tf/string-list-init (2010-07-04) 1 commit
- string_list: Add STRING_LIST_INIT macro and make use of it.
(this branch uses ar/string-list-foreach.)
* en/d-f-conflict-fix (2010-07-27) 7 commits
(merged to 'next' on 2010-08-03 at 7f78604)
+ t/t6035-merge-dir-to-symlink.sh: Remove TODO on passing test
+ fast-import: Improve robustness when D->F changes provided in wrong order
+ fast-export: Fix output order of D/F changes
+ merge_recursive: Fix renames across paths below D/F conflicts
+ merge-recursive: Fix D/F conflicts
+ Add a rename + D/F conflict testcase
+ Add additional testcases for D/F conflicts
* ab/i18n (2010-07-19) 2 commits
- tests: rename test to work around GNU gettext bug
- Add infrastructure for translating Git with gettext
(this branch is used by tr/ab-i18n-fix.)
* tc/checkout-B (2010-08-10) 4 commits
(merged to 'next' on 2010-08-11 at 5433b51)
+ builtin/checkout: handle -B from detached HEAD correctly
+ builtin/checkout: learn -B
+ builtin/checkout: reword hint for -b
+ add tests for checkout -b
* eb/double-convert-before-merge (2010-07-02) 3 commits
- Don't expand CRLFs when normalizing text during merge
- Try normalizing files to avoid delete/modify conflicts when merging
- Avoid conflicts when merging branches with mixed normalization
(this branch is used by jn/merge-renormalize.)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:18
Junio C Hamano wrote:
* by/line-log (2010-08-11) 18 commits
Is there a simple and current “here is how to try this code and what
it will do for you” document?
In my imagination such a document is about three lines, including an
example. :)
* jn/commit-no-change-wo-status (2010-07-24) 9 commits
. commit: suppress status summary when no changes staged
. commit --dry-run: give advice on empty amend
...
Could you revert the tip of this one? What remains is a good
cleanup (+ change in --dry-run output for consistency), I think.
There was no positive feedback about suppressing the status summary.
I am afraid it might be a bad idea; I’d be happy if people have other
ideas for making the output friendlier.
* jn/merge-renormalize (2010-08-05) 12 commits
...
. t4200 (rerere): modernize style
...
. t6038 (merge.renormalize): style nitpicks
Should I resend with these two ejected into a separate series?
* jn/paginate-fix (2010-08-05) 13 commits
...
I had trouble merging these three topics to 'pu' and ran out of time my
git Wednesday this week.
I’ll try to find time to investigate and publish conflict-resolution
branches.
* jn/svn-fe (2010-08-09) 10 commits
...
There was a screw-up on my part---I should have dropped the first one and
branched this off of jn/parse-date-basic (I'll fix it up before merging
this to 'next').
I didn’t notice the existing parse-date-basic branch. Sorry about
that.
On Thu, Aug 12, 2010 at 01:41, Jonathan Nieder [off-list ref] wrote:
Junio C Hamano wrote:
quoted
* jn/commit-no-change-wo-status (2010-07-24) 9 commits
. commit: suppress status summary when no changes staged
. commit --dry-run: give advice on empty amend
...
Could you revert the tip of this one? What remains is a good
cleanup (+ change in --dry-run output for consistency), I think.
There was no positive feedback about suppressing the status summary.
I am afraid it might be a bad idea; I’d be happy if people have other
ideas for making the output friendlier.
I think it's a little unfriendlier with this patch than without. With
`color.ui = auto' on and `touch meh && git commit' you'll have "meh"
pointed out to you in bright red as the thing you forgot, so you know
what to "git add".
Just saying that you need to "git add" doesn't give you that context.
But maybe the wall of text from "git status" can be a bit confusing to
users, especially in the pathological case. Perhaps one way to solve
that would be to give the message more color:
$ git commit
A # On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
X # blahblah
Y nothing added to commit but untracked files present (use "git add" to track)
X is now red, but Y is the same color as the rest of the
message. Maybe we could give that the "info" color (used in
e.g. test-lib.sh). Then users might read it as Y->X->A instead of
A->X->Y.
But I don't know, the "git commit" output doesn't confuse me so I'm
not in the target audience.
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:18
Ævar Arnfjörð Bjarmason wrote:
But I don't know, the "git commit" output doesn't confuse me so I'm
not in the target audience.
For what it’s worth, I had three scenarios in mind:
Getting started
---------------
One way to learn a program is to just try things. Some people take
this practice to an extreme and unforunately (1) would expect “git
commit” to do the same thing as “cvs commit” and (2) would not want to
read a manual or a long stream of text when it does not do so.
I hope we can streamline that process somehow, for example by
starting the output with the error message:
$ git commit
fatal: no changes added to commit
hint: use 'git add' and 'git reset' to update what will be committed
hint: you have 37 untracked files; use 'git status' to list them
24-line terminal
----------------
When I forget to stage changes, the previous output in the terminal’s
scrollback buffer may give a reminder of what those changes were.
The current “git status” output makes that information harder to find.
For the same reason, I basically never use git status without -s.
Before status --short existed, I used diff-files and ls-files -o.
Now I generally use “add -u”, “diff --cached”, and “add/reset -p”.
Need reminder of changes
------------------------
Some people forget where they are and would be confused if “git
commit” just failed without explaining why. They need an indication
of what just happened and what they need to try to do to fix it up.
For such people, the existing output is fine. With a successful
series, the new output would also be fine, and running “git checkout”
or “git status” would seem the most natural thing in the world rather
than an imposition.
Hope that helps.
Jonathan
It looks like you pulled my original submission, despite the fact that
you commented on v3 of the series. Granted, everything after v1 was
just commit log wording changes and testsuite fixups, but I'll resend
to make it easy for you to grab the latest.
* en/fast-export-fix (2010-07-17) 2 commits
- fast-export: Add a --full-tree option
- fast-export: Fix dropping of files with --import-marks and path limiting
<snip>
* en/d-f-conflict-fix (2010-07-27) 7 commits
(merged to 'next' on 2010-08-03 at 7f78604)
+ t/t6035-merge-dir-to-symlink.sh: Remove TODO on passing test
+ fast-import: Improve robustness when D->F changes provided in wrong order
+ fast-export: Fix output order of D/F changes
+ merge_recursive: Fix renames across paths below D/F conflicts
+ merge-recursive: Fix D/F conflicts
+ Add a rename + D/F conflict testcase
+ Add additional testcases for D/F conflicts
Out of curiosity, is there anything preventing these two series from
advancing? I was particularly hoping that the fix (first patch) in
the en/fast-export-fix series would be applied to maint; Sverre seemed
to agree -- http://article.gmane.org/gmane.comp.version-control.git/151046.
If it's just time, I understand, I was just curious if there was
anything I could or should do to help these series (or the new
en/rebase-against-rebase-fix one) along.
Thanks,
Elijah
From: Johannes Sixt <hidden> Date: 2016-06-15 22:49:18
[Sorry for the Cc spam; I lack the time to conduct individual messages.]
I compiled many topics in pu and ran the test suite on Windows,
particularly those that "look good" and "will merge to next". Here's a report.
Today's next produces this warning:
merge-recursive.c: In function 'process_df_entry':
merge-recursive.c:1246: warning: unused variable 'o_sha'
(line number may be different) because o_sha is only used inside assert().
I don't know how you would like this fixed.
Am 8/12/2010 1:35, schrieb Junio C Hamano:
* jn/svn-fe (2010-08-09) 10 commits
- svn-fe manual: Clarify warning about deltas in dump files
- Update svn-fe manual
- SVN dump parser
- Infrastructure to write revisions in fast-export format
- Add stream helper library
- Add string-specific memory pool
- Add treap implementation
- Add memory pool library
- Introduce vcs-svn lib
- Export parse_date_basic() to convert a date string to timestamp
There was a screw-up on my part---I should have dropped the first one and
branched this off of jn/parse-date-basic (I'll fix it up before merging
this to 'next').
This fails to build under MinGW because we don't have strtok_r() and a
whole lot of other things that I didn't even look at. Can we have an
opt-in or opt-out for this?
* gb/shell-ext (2010-07-28) 3 commits
- Add sample commands for git-shell
- Add interactive mode to git-shell for user-friendliness
- Allow creation of arbitrary git-shell commands
This needs work on Windows because we do not have geteuid(), perhaps just
a compiler flag -Dgeteuid=getuid
* jn/apply-filename-with-sp (2010-07-23) 4 commits
- apply: Handle traditional patches with space in filename
- t4135 (apply): use expand instead of pr for portability
- tests: Test how well "git apply" copes with weird filenames
- apply: Split quoted filename handling into new function
Looked Ok. Will merge to 'next'.
The test cases that work with files with tabs must have a prerequisite;
see t3600-rm.sh.
* il/rfc-remote-fd-ext (2010-07-31) 4 commits
- Rewrite bidirectional traffic loop
- gitignore: Ignore the new /git-remote-{ext,fd} helpers
- New remote helper: git-remote-ext
- New remote helper git-remote-fd
We do not have EWOULDBLOCK on Windows. Is it needed or could the
respective write() loop in remote-ext.c not be replaced by write_in_full()?
* en/d-f-conflict-fix (2010-07-27) 7 commits
(merged to 'next' on 2010-08-03 at 7f78604)
+ t/t6035-merge-dir-to-symlink.sh: Remove TODO on passing test
+ fast-import: Improve robustness when D->F changes provided in wrong order
+ fast-export: Fix output order of D/F changes
+ merge_recursive: Fix renames across paths below D/F conflicts
+ merge-recursive: Fix D/F conflicts
+ Add a rename + D/F conflict testcase
+ Add additional testcases for D/F conflicts
The new tests in t/t3509-cherry-pick-merge-df.sh and t9350-fast-export.sh
need SYMLINKS prerequisite.
-- Hannes
Maybe that should be (untested):
char* home = expand_user_path("~");
To avoid duplicating the getenv("HOME") code (e.g. if someone wants to
make a getpwuid fallback in the future).
On Thu, Aug 12, 2010 at 11:23:39AM +0200, Johannes Sixt wrote:
quoted
* il/rfc-remote-fd-ext (2010-07-31) 4 commits
- Rewrite bidirectional traffic loop
- gitignore: Ignore the new /git-remote-{ext,fd} helpers
- New remote helper: git-remote-ext
- New remote helper git-remote-fd
We do not have EWOULDBLOCK on Windows. Is it needed or could the
respective write() loop in remote-ext.c not be replaced by write_in_full()?
No, the writes can't be replaced by write_in_full() without changing what
the code does, because write_in_full() retries short writes, whereas current
code does not retry reads nor writes. And retrying reads/writes in code
juggling with multiple fds is usally no-no.
The EWOULDBLOCK is needed on some systems if fds involved are nonblocking[1]. I
think the easiest way to handle system that has EAGAIN but not EWOULDBLOCK
would be:
#ifndef EWOULDBLOCK
#define EWOULDBLOCK EGAIN
#endif
[1] Some systems return EAGAIN on read/write failed due to blocking (with
EAGAIN == EWOULDBLOCK), others return EWOULDBLOCK.
-Ilari
Another case for the modify() helper function I guess.
quoted
* jn/apply-filename-with-sp (2010-07-23) 4 commits
- apply: Handle traditional patches with space in filename
- t4135 (apply): use expand instead of pr for portability
- tests: Test how well "git apply" copes with weird filenames
- apply: Split quoted filename handling into new function
Looked Ok. Will merge to 'next'.
The test cases that work with files with tabs must have a prerequisite;
see t3600-rm.sh.
Hrm, another test with tabs in filenames. There are already three
setting the TABS_IN_FILENAMES prereq, but I missed this one.
I should probably move those checks into some prereq library, maybe to
test-lib.sh itself.
From: Johannes Sixt <hidden> Date: 2016-06-15 22:49:18
Am 8/12/2010 12:21, schrieb Ilari Liusvaara:
On Thu, Aug 12, 2010 at 11:23:39AM +0200, Johannes Sixt wrote:
quoted
quoted
* il/rfc-remote-fd-ext (2010-07-31) 4 commits
- Rewrite bidirectional traffic loop
- gitignore: Ignore the new /git-remote-{ext,fd} helpers
- New remote helper: git-remote-ext
- New remote helper git-remote-fd
We do not have EWOULDBLOCK on Windows. Is it needed or could the
respective write() loop in remote-ext.c not be replaced by write_in_full()?
No, the writes can't be replaced by write_in_full() without changing what
the code does, because write_in_full() retries short writes, whereas current
code does not retry reads nor writes. And retrying reads/writes in code
juggling with multiple fds is usally no-no.
builtin/remote-ext.c uses a loop that looks very much like what
write_in_full() does; transport-helper.c's checks for EAGAIN look very
similar to xwrite(). Why can't you reuse these functions?
The EWOULDBLOCK is needed on some systems if fds involved are nonblocking[1]. I
think the easiest way to handle system that has EAGAIN but not EWOULDBLOCK
would be:
#ifndef EWOULDBLOCK
#define EWOULDBLOCK EGAIN
#endif
[1] Some systems return EAGAIN on read/write failed due to blocking (with
EAGAIN == EWOULDBLOCK), others return EWOULDBLOCK.
But shouldn't then xwrite() and xread() be extended to check also for
EWOULDBLOCK?
-- Hannes
On Thu, Aug 12, 2010 at 3:23 AM, Johannes Sixt [off-list ref] wrote:
[Sorry for the Cc spam; I lack the time to conduct individual messages.]
I compiled many topics in pu and ran the test suite on Windows,
particularly those that "look good" and "will merge to next". Here's a report.
Today's next produces this warning:
merge-recursive.c: In function 'process_df_entry':
merge-recursive.c:1246: warning: unused variable 'o_sha'
(line number may be different) because o_sha is only used inside assert().
I don't know how you would like this fixed.
This is caused by en/d-f-conflict-fix. I could remove the definition
of o_sha and the corresponding assert, or (my preference) just add a
simple null statement:
(void)o_sha;
What would others prefer?
Already fixed in v4 sent out last night (and was fixed in v3 that
Junio commented on, but for some reason he merged v1 instead).
quoted
* en/d-f-conflict-fix (2010-07-27) 7 commits
(merged to 'next' on 2010-08-03 at 7f78604)
+ t/t6035-merge-dir-to-symlink.sh: Remove TODO on passing test
+ fast-import: Improve robustness when D->F changes provided in wrong order
+ fast-export: Fix output order of D/F changes
+ merge_recursive: Fix renames across paths below D/F conflicts
+ merge-recursive: Fix D/F conflicts
+ Add a rename + D/F conflict testcase
+ Add additional testcases for D/F conflicts
The new tests in t/t3509-cherry-pick-merge-df.sh and t9350-fast-export.sh
need SYMLINKS prerequisite.
I'll fix them up. Sorry for being less familiar with the rules, but
since these are in next, do I resend the series or just the new fixes?
Thanks,
Elijah
On Thu, Aug 12, 2010 at 12:31:33PM +0200, Johannes Sixt wrote:
builtin/remote-ext.c uses a loop that looks very much like what
write_in_full() does; transport-helper.c's checks for EAGAIN look very
similar to xwrite(). Why can't you reuse these functions?
Ah, the request sending loop (send_git_request()), not the bidirectional loop
(my bad). Yes, that function can be simplified a lot (patch sent).
quoted
[1] Some systems return EAGAIN on read/write failed due to blocking (with
EAGAIN == EWOULDBLOCK), others return EWOULDBLOCK.
But shouldn't then xwrite() and xread() be extended to check also for
EWOULDBLOCK?
Based on what I understand, yes. read() and write() that fails due to blocking
being needed but disabled returns EWOULDBLOCK, which may or may not be the
same as EAGAIN, so the return value in no-blocking case equals EAGAIN only
if EAGAIN == EWOULDBLOCK, which isn't guaranteed.
Have a macro that does the non-fatal error check?
-Ilari
On Thu, Aug 12, 2010 at 11:35, Erik Faye-Lund [off-list ref] wrote:
On Thu, Aug 12, 2010 at 12:20 PM, Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
quoted
On Thu, Aug 12, 2010 at 09:23, Johannes Sixt [off-list ref] wrote:
quoted
[Sorry for the Cc spam; I lack the time to conduct individual messages.]
I compiled many topics in pu and ran the test suite on Windows,
A Windows smoker would be useful :)
I guess I could look into setting one up. Where would I look for the
most up-to-date instructions on doing this?
The smoke testing section in t/README in pu.
Here's a small script I use to automate my smoke reports:
http://github.com/avar/linode-etc/blob/master/bin/cron/build-and-install-git
But it's crappy and incomplete, we/I still need to write something
easy to set up that does automatic bisecting etc. on errors, tests
multiple branches and all that good stuff.
In the meantime smoking pu daily in cron should do.
From: Chris Packham <hidden> Date: 2016-06-15 22:49:18
On 12/08/10 09:50, Ævar Arnfjörð Bjarmason wrote:
On Thu, Aug 12, 2010 at 11:35, Erik Faye-Lund [off-list ref] wrote:
quoted
On Thu, Aug 12, 2010 at 12:20 PM, Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
quoted
On Thu, Aug 12, 2010 at 09:23, Johannes Sixt [off-list ref] wrote:
quoted
[Sorry for the Cc spam; I lack the time to conduct individual messages.]
I compiled many topics in pu and ran the test suite on Windows,
A Windows smoker would be useful :)
I guess I could look into setting one up. Where would I look for the
most up-to-date instructions on doing this?
The smoke testing section in t/README in pu.
Here's a small script I use to automate my smoke reports:
http://github.com/avar/linode-etc/blob/master/bin/cron/build-and-install-git
But it's crappy and incomplete, we/I still need to write something
easy to set up that does automatic bisecting etc. on errors, tests
multiple branches and all that good stuff.
In the meantime smoking pu daily in cron should do.
I've got a spare windows box at work I could set something up on it.
I've never used msysgit or MinGW so I might need some instructions/links
on that in addition to the smoker stuff.
On Thu, Aug 12, 2010 at 17:34, Chris Packham [off-list ref] wrote:
I've got a spare windows box at work I could set something up on it.
I've never used msysgit or MinGW so I might need some instructions/links
on that in addition to the smoker stuff.
I won't be able to help you there, sorry. I know Windows about as well
as IBM z/OS, which is to say not at all :)
From: Chris Packham <hidden> Date: 2016-06-15 22:49:18
On 12/08/10 11:35, Ævar Arnfjörð Bjarmason wrote:
On Thu, Aug 12, 2010 at 17:34, Chris Packham [off-list ref] wrote:
quoted
I've got a spare windows box at work I could set something up on it.
I've never used msysgit or MinGW so I might need some instructions/links
on that in addition to the smoker stuff.
I won't be able to help you there, sorry. I know Windows about as well
as IBM z/OS, which is to say not at all :)
I've got msysgit installed now via the net installer. I checked out
Avar's (Aevar?) branch One problem is that I don't have any of the perl
TAP modules. It's complaining about TAP/Harness/Archive.pm. Any
suggestions for installing additional perl modules under msysgit?
Another problem is that the mingw sh.exe is _really_ slow (the box is an
oldish Dell Latitude). It took a while for the net installer to run and
compile the devel branch but it got there eventually. It's not a huge
issue for me as the box is sitting idle but any suggestions for making
it run a bit smoother are welcome.
On Thu, Aug 12, 2010 at 22:19, Chris Packham [off-list ref] wrote:
I checked out Avar's (Aevar?)
Whatever works :)
branch One problem is that I don't have any of the perl TAP
modules. It's complaining about TAP/Harness/Archive.pm. Any
suggestions for installing additional perl modules under msysgit?
I don't know what msysgit does for perl but if you can make it use
strawberry perl's perl + modules that'd be easiest:
http://strawberryperl.com
It comes with an easy-to use CPAN shell out of the box.
Another problem is that the mingw sh.exe is _really_ slow (the box is an
oldish Dell Latitude).
Odd that sh.exe is the slowest bit.
One thing (as the t/README notes) that'll make the tests much faster
is using a ramdisk for the trash directory, but I don't know if
Windows can do that.
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:18
Johannes Sixt wrote:
Am 8/12/2010 1:35, schrieb Junio C Hamano:
quoted
* jn/apply-filename-with-sp (2010-07-23) 4 commits
- apply: Handle traditional patches with space in filename
- t4135 (apply): use expand instead of pr for portability
- tests: Test how well "git apply" copes with weird filenames
- apply: Split quoted filename handling into new function
Looked Ok. Will merge to 'next'.
The test cases that work with files with tabs must have a prerequisite;
see t3600-rm.sh.
Would this work?
-- 8< --
Subject: t4135 (apply): filenames with tabs are not usable on NTFS
Move the code setting up the FUNNYNAMES prerequisite from
v1.3.0-rc1~67 (workaround fat/ntfs deficiences for t3600-rm.sh,
2006-03-03) to test-lib and use it.
Reported-by: Johannes Sixt <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
t/t3600-rm.sh | 11 +++--------
t/t4135-apply-weird-filenames.sh | 17 +++++++++--------
t/test-lib.sh | 11 +++++++++++
3 files changed, 23 insertions(+), 16 deletions(-)
@@ -14,15 +14,10 @@ test_expect_success \gitadd--foobarbaz'space embedded'-q&&gitcommit-m'add normal files'"-iftouch--'tab embedded''newline-embedded'2>/dev/null-then-test_set_prereqFUNNYNAMES-else-say'Your filesystem does not allow tabs in filenames.'-fi- test_expect_successFUNNYNAMES'add files with funny names'"+>'newline+embedded'&&+>'tab embedded'&&gitadd--'tab embedded''newline embedded'&&gitcommit-m'add files with tabs and newlines'
@@ -57,7 +58,7 @@ try_filename() {test_cmppostimage.saved'$postimage'"-test_expect_$exp2UNIDIFF"$desc, traditional patch""+test_expect_$exp2${prereq:+$prereq,}UNIDIFF"$desc, traditional patch""reset_preimage&&echopreimage>'$postimage.orig'&&echopostimage>'$postimage'&&
@@ -70,7 +71,7 @@ try_filename() {test_cmppostimage.saved'$postimage'"-test_expect_$exp3FULLDIFF"$desc, traditional file creation patch""+test_expect_$exp3${prereq:+$prereq,}FULLDIFF"$desc, traditional file creation patch""reset_preimage&&reset_subdirs&&echopostimage>b/'$postimage'&&
On Thu, Aug 12, 2010 at 22:40, Jonathan Nieder [off-list ref] wrote:
Johannes Sixt wrote:
quoted
Am 8/12/2010 1:35, schrieb Junio C Hamano:
quoted
quoted
* jn/apply-filename-with-sp (2010-07-23) 4 commits
- apply: Handle traditional patches with space in filename
- t4135 (apply): use expand instead of pr for portability
- tests: Test how well "git apply" copes with weird filenames
- apply: Split quoted filename handling into new function
Looked Ok. Will merge to 'next'.
The test cases that work with files with tabs must have a prerequisite;
see t3600-rm.sh.
Would this work?
This is nice, but incomplete. I just recently added a bunch of
TABS_IN_FILENAMES prereqs to pu, moving that prereq setup to
test-lib.sh + making the rm test use it would be better, we might want
more specific name restrictions than just "funny".
Please also add docs for the new prereq to t/README. There's a new
section for those now too.
Thanks.
From: Chris Packham <hidden> Date: 2016-06-15 22:49:18
On 12/08/10 15:29, Ævar Arnfjörð Bjarmason wrote:
On Thu, Aug 12, 2010 at 22:19, Chris Packham [off-list ref] wrote:
quoted
I checked out Avar's (Aevar?)
Whatever works :)
quoted
branch One problem is that I don't have any of the perl TAP
modules. It's complaining about TAP/Harness/Archive.pm. Any
suggestions for installing additional perl modules under msysgit?
I don't know what msysgit does for perl but if you can make it use
strawberry perl's perl + modules that'd be easiest:
http://strawberryperl.com
I'll see if I can get it to work. Msys comes with its own perl so maybe
there is another way.
It comes with an easy-to use CPAN shell out of the box.
quoted
Another problem is that the mingw sh.exe is _really_ slow (the box is an
oldish Dell Latitude).
Odd that sh.exe is the slowest bit.
I'm probably pointing the finger at sh.exe but it is more that something
else it is doing is slowing things down (probably the fancy PS1 setting).
One thing (as the t/README notes) that'll make the tests much faster
is using a ramdisk for the trash directory, but I don't know if
Windows can do that.
I doubt windows has the capability (heck they've only had 3 file systems
in the last 20 years).
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:18
(pruned Ccs)
Johannes Sixt wrote:
Am 8/12/2010 1:35, schrieb Junio C Hamano:
quoted
* jn/svn-fe (2010-08-09) 10 commits
[...]
This fails to build under MinGW because we don't have strtok_r() and a
whole lot of other things that I didn't even look at. Can we have an
opt-in or opt-out for this?
How about something like this instead?
-- 8< --
Subject: vcs-svn: Port to Windows
MSys #define-s dirent away. Avoid trouble by avoiding that
identifier.
Windows does not have strtok_r (and while does have an identical
strtok_s, but it is not obvious how to use it). Grab an
implementation from glibc.
The svn-fe test fails in the “svn export” step because of the
lack of symlink support. With a less ambitious dump, it passes.
Cc: Johannes Sixt <redacted>
Cc: Ramkumar Ramachandra <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Makefile | 8 ++
compat/strtok_r.c | 61 ++++++++++++++++
git-compat-util.h | 5 ++
t/t9010-svn-fe.sh | 4 +-
vcs-svn/fast_export.c | 4 +-
vcs-svn/repo_tree.c | 188 ++++++++++++++++++++++++------------------------
6 files changed, 172 insertions(+), 98 deletions(-)
create mode 100644 compat/strtok_r.c
@@ -68,6 +68,8 @@ all::## Define NO_MKSTEMPS if you don't have mkstemps in the C library.#+# Define NO_STRTOK_R if you don't have strtok_r in the C library.+## Define NO_LIBGEN_H if you don't have libgen.h.## Define NEEDS_LIBGEN if your libgen needs -lgen when linking
@@ -0,0 +1,61 @@+/* Reentrant string tokenizer. Generic version.+Copyright(C)1991,1996-1999,2001,2004FreeSoftwareFoundation,Inc.+ThisfileispartoftheGNUCLibrary.++TheGNUCLibraryisfreesoftware;youcanredistributeitand/or+modifyitunderthetermsoftheGNULesserGeneralPublic+LicenseaspublishedbytheFreeSoftwareFoundation;either+version2.1oftheLicense,or(atyouroption)anylaterversion.++TheGNUCLibraryisdistributedinthehopethatitwillbeuseful,+butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof+MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.SeetheGNU+LesserGeneralPublicLicenseformoredetails.++YoushouldhavereceivedacopyoftheGNULesserGeneralPublic+LicensealongwiththeGNUCLibrary;ifnot,writetotheFree+SoftwareFoundation,Inc.,59TemplePlace,Suite330,Boston,MA+02111-1307USA.*/++#include"../git-compat-util.h"++/* Parse S into tokens separated by characters in DELIM.+IfSisNULL,thesavedpointerinSAVE_PTRisusedas+thenextstartingpoint.Forexample:+chars[]="-abc-=-def";+char*sp;+x=strtok_r(s,"-",&sp);// x = "abc", sp = "=-def"+x=strtok_r(NULL,"-=",&sp);// x = "def", sp = NULL+x=strtok_r(NULL,"=",&sp);// x = NULL+// s = "abc\0-def\0"+*/+char*+gitstrtok_r(char*s,constchar*delim,char**save_ptr)+{+char*token;++if(s==NULL)+s=*save_ptr;++/* Scan leading delimiters. */+s+=strspn(s,delim);+if(*s=='\0')+{+*save_ptr=s;+returnNULL;+}++/* Find the end of the token. */+token=s;+s=strpbrk(token,delim);+if(s==NULL)+/* This token finishes the string. */+*save_ptr=token+strlen(token);+else+{+/* Terminate the token and make *SAVE_PTR point past it. */+*s='\0';+*save_ptr=s+1;+}+returntoken;+}
@@ -27,18 +27,18 @@ struct repo_commit {uint32_troot_dir_offset;};-/* Memory pools for commit, dir and dirent */+/* Memory pools for commit, dir and dent */obj_pool_gen(commit,structrepo_commit,4096)obj_pool_gen(dir,structrepo_dir,4096)-obj_pool_gen(dirent,structrepo_dirent,4096)+obj_pool_gen(dent,structrepo_dent,4096)staticuint32_tactive_commit;staticuint32_tmark;-staticintrepo_dirent_name_cmp(constvoid*a,constvoid*b);+staticintrepo_dent_name_cmp(constvoid*a,constvoid*b);/* Treap for directory entries */-trp_gen(static,dirent_,structrepo_dirent,children,dirent,repo_dirent_name_cmp);+trp_gen(static,dent_,structrepo_dent,children,dent,repo_dent_name_cmp);uint32_tnext_blob_mark(void){
On Thu, Aug 12, 2010 at 22:58, Chris Packham [off-list ref] wrote:
On 12/08/10 15:29, Ævar Arnfjörð Bjarmason wrote:
quoted
On Thu, Aug 12, 2010 at 22:19, Chris Packham [off-list ref] wrote:
quoted
I checked out Avar's (Aevar?)
Whatever works :)
quoted
branch One problem is that I don't have any of the perl TAP
modules. It's complaining about TAP/Harness/Archive.pm. Any
suggestions for installing additional perl modules under msysgit?
I don't know what msysgit does for perl but if you can make it use
strawberry perl's perl + modules that'd be easiest:
http://strawberryperl.com
I'll see if I can get it to work. Msys comes with its own perl so maybe
there is another way.
If it comes with its own perl it should also have a cpan shell:
perl -MCPAN -e 'install TAP::Harness::Archive'
That should be easier than installing strawberry in addition to the
mingw perl.
From: Jakub Narebski <hidden> Date: 2016-06-15 22:49:18
Jonathan Nieder [off-list ref] writes:
quoted hunk
How about something like this instead?
-- 8< --
Subject: vcs-svn: Port to Windows
MSys #define-s dirent away. Avoid trouble by avoiding that
identifier.
Windows does not have strtok_r (and while does have an identical
strtok_s, but it is not obvious how to use it). Grab an
implementation from glibc.
The svn-fe test fails in the “svn export” step because of the
lack of symlink support. With a less ambitious dump, it passes.
Cc: Johannes Sixt <redacted>
Cc: Ramkumar Ramachandra <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Makefile | 8 ++
compat/strtok_r.c | 61 ++++++++++++++++
git-compat-util.h | 5 ++
t/t9010-svn-fe.sh | 4 +-
vcs-svn/fast_export.c | 4 +-
vcs-svn/repo_tree.c | 188 ++++++++++++++++++++++++------------------------
6 files changed, 172 insertions(+), 98 deletions(-)
create mode 100644 compat/strtok_r.c
@@ -68,6 +68,8 @@ all::## Define NO_MKSTEMPS if you don't have mkstemps in the C library.#+# Define NO_STRTOK_R if you don't have strtok_r in the C library.+## Define NO_LIBGEN_H if you don't have libgen.h.## Define NEEDS_LIBGEN if your libgen needs -lgen when linking
You are missing autodetection by autoconf, i.e. changes to
config.mak.in and to configure.ac
#
# Define NO_STRTOK_R if you don't have strtok_r in the C library.
GIT_CHECK_FUNC(strtok_r,
[NO_STRTOK_R=],
[NO_STRTOK_R=YesPlease])
AC_SUBST(NO_STRTOK_R)
--
Jakub Narebski
Poland
ShadeHawk on #git
From: Johannes Sixt <hidden> Date: 2016-06-15 22:49:19
Am 13.08.2010 02:08, schrieb Jonathan Nieder:
(pruned Ccs)
Johannes Sixt wrote:
quoted
Am 8/12/2010 1:35, schrieb Junio C Hamano:
quoted
quoted
* jn/svn-fe (2010-08-09) 10 commits
[...]
quoted
This fails to build under MinGW because we don't have strtok_r() and a
whole lot of other things that I didn't even look at. Can we have an
opt-in or opt-out for this?
How about something like this instead?
-- 8< --
Subject: vcs-svn: Port to Windows
MSys #define-s dirent away. Avoid trouble by avoiding that
identifier.
Windows does not have strtok_r (and while does have an identical
strtok_s, but it is not obvious how to use it). Grab an
implementation from glibc.
The svn-fe test fails in the “svn export” step because of the
lack of symlink support. With a less ambitious dump, it passes.
Cc: Johannes Sixt<redacted>
Cc: Ramkumar Ramachandra<redacted>
Signed-off-by: Jonathan Nieder<redacted>
Thanks, it compiles with this patch and passes the test suite.
Acked-by: Johannes Sixt<redacted>
The license, LGPL 2.1 or later is OK, I assume?
-- Hannes
From: Johannes Sixt <hidden> Date: 2016-06-15 22:49:19
Am 13.08.2010 00:40, schrieb Jonathan Nieder:
Johannes Sixt wrote:
quoted
Am 8/12/2010 1:35, schrieb Junio C Hamano:
quoted
quoted
* jn/apply-filename-with-sp (2010-07-23) 4 commits
- apply: Handle traditional patches with space in filename
- t4135 (apply): use expand instead of pr for portability
- tests: Test how well "git apply" copes with weird filenames
- apply: Split quoted filename handling into new function
Looked Ok. Will merge to 'next'.
The test cases that work with files with tabs must have a prerequisite;
see t3600-rm.sh.
Would this work?
-- 8< --
Subject: t4135 (apply): filenames with tabs are not usable on NTFS
Move the code setting up the FUNNYNAMES prerequisite from
v1.3.0-rc1~67 (workaround fat/ntfs deficiences for t3600-rm.sh,
2006-03-03) to test-lib and use it.
Reported-by: Johannes Sixt<redacted>
Signed-off-by: Jonathan Nieder<redacted>
No, it needs this squashed in (warning, whitespace damaged), except that
the prerequisite EXPAND is nowhere defined - it is only a hint for you(?)
that we need something else there because we don't have expand on Windows.
I don't know why the test with quotes fails. It must be a bug in MSYS
bash, because the file system does not have any problems with quotes in
file names.
diff --git a/t/t4135-apply-weird-filenames.sh
b/t/t4135-apply-weird-filenames.sh
index 5c7165e..6730a30 100755
Without the braces in this check the error message is still printed. I
didn't test whether just writing 2>/dev/null first would suppress it as well.
BTW, I would prefer to keep the test in t3600 and t4135, that it doesn't
happen for every other test script unnecessarily.
-- Hannes
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
Johannes Sixt wrote:
Am 13.08.2010 02:08, schrieb Jonathan Nieder:
quoted
Subject: vcs-svn: Port to Windows
MSys #define-s dirent away. Avoid trouble by avoiding that
identifier.
Windows does not have strtok_r (and while does have an identical
strtok_s, but it is not obvious how to use it). Grab an
implementation from glibc.
The svn-fe test fails in the “svn export” step because of the
lack of symlink support. With a less ambitious dump, it passes.
Cc: Johannes Sixt <redacted>
Cc: Ramkumar Ramachandra <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Thanks, it compiles with this patch and passes the test suite.
Acked-by: Johannes Sixt <redacted>
The license, LGPL 2.1 or later is OK, I assume?
xdiff uses it, so I think that should be fine. If not, it shouldn’t
be hard to rewrite based on the man page; I only took the glibc
version because it was easy to do.
Here’s a split-up patch. Patch 1 adds an autoconf test (thanks,
Jakub!). Patch 2 is a little (though not much) shorter than the blind
search-and-replace I sent before. This uses uint32_t instead of int
in patch 3 because the vcs-svn lib uses 32-bit lengths elsewhere.
Not tested on Windows but it is not so different from v1 which was.
Thanks again for the help.
Jonathan Nieder (5):
compat: add strtok_r()
vcs-svn: Rename dirent pool to build on Windows
vcs-svn: Avoid %z in format string
t9010 (svn-fe): use Unix-style path in URI
t9010 (svn-fe): avoid symlinks in test
Makefile | 8 +++
compat/strtok_r.c | 61 ++++++++++++++++++++
config.mak.in | 1 +
configure.ac | 6 ++
git-compat-util.h | 5 ++
t/t9010-svn-fe.sh | 4 +-
vcs-svn/fast_export.c | 5 +-
vcs-svn/repo_tree.c | 146 ++++++++++++++++++++++++------------------------
8 files changed, 159 insertions(+), 77 deletions(-)
create mode 100644 compat/strtok_r.c
--
1.7.2.1.544.ga752d.dirty
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
Windows does not have strtok_r (and while it does have an identical
strtok_s, but it is not obvious how to use it). Grab an
implementation from glibc.
The svn-fe tool uses strtok_r to parse paths.
Acked-by: Johannes Sixt <redacted>
Helped-by: Jakub Narebski [off-list ref]
Signed-off-by: Jonathan Nieder <redacted>
---
I have carried over Hannes’s ack; hopefully that is okay.
Makefile | 8 +++++++
compat/strtok_r.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++
config.mak.in | 1 +
configure.ac | 6 +++++
git-compat-util.h | 5 ++++
5 files changed, 81 insertions(+), 0 deletions(-)
create mode 100644 compat/strtok_r.c
@@ -68,6 +68,8 @@ all::## Define NO_MKSTEMPS if you don't have mkstemps in the C library.#+# Define NO_STRTOK_R if you don't have strtok_r in the C library.+## Define NO_LIBGEN_H if you don't have libgen.h.## Define NEEDS_LIBGEN if your libgen needs -lgen when linking
@@ -0,0 +1,61 @@+/* Reentrant string tokenizer. Generic version.+Copyright(C)1991,1996-1999,2001,2004FreeSoftwareFoundation,Inc.+ThisfileispartoftheGNUCLibrary.++TheGNUCLibraryisfreesoftware;youcanredistributeitand/or+modifyitunderthetermsoftheGNULesserGeneralPublic+LicenseaspublishedbytheFreeSoftwareFoundation;either+version2.1oftheLicense,or(atyouroption)anylaterversion.++TheGNUCLibraryisdistributedinthehopethatitwillbeuseful,+butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof+MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.SeetheGNU+LesserGeneralPublicLicenseformoredetails.++YoushouldhavereceivedacopyoftheGNULesserGeneralPublic+LicensealongwiththeGNUCLibrary;ifnot,writetotheFree+SoftwareFoundation,Inc.,59TemplePlace,Suite330,Boston,MA+02111-1307USA.*/++#include"../git-compat-util.h"++/* Parse S into tokens separated by characters in DELIM.+IfSisNULL,thesavedpointerinSAVE_PTRisusedas+thenextstartingpoint.Forexample:+chars[]="-abc-=-def";+char*sp;+x=strtok_r(s,"-",&sp);// x = "abc", sp = "=-def"+x=strtok_r(NULL,"-=",&sp);// x = "def", sp = NULL+x=strtok_r(NULL,"=",&sp);// x = NULL+// s = "abc\0-def\0"+*/+char*+gitstrtok_r(char*s,constchar*delim,char**save_ptr)+{+char*token;++if(s==NULL)+s=*save_ptr;++/* Scan leading delimiters. */+s+=strspn(s,delim);+if(*s=='\0')+{+*save_ptr=s;+returnNULL;+}++/* Find the end of the token. */+token=s;+s=strpbrk(token,delim);+if(s==NULL)+/* This token finishes the string. */+*save_ptr=token+strlen(token);+else+{+/* Terminate the token and make *SAVE_PTR point past it. */+*s='\0';+*save_ptr=s+1;+}+returntoken;+}
@@ -783,6 +783,12 @@ GIT_CHECK_FUNC(strcasestr, [NO_STRCASESTR=YesPlease]) AC_SUBST(NO_STRCASESTR) #+# Define NO_STRTOK_R if you don't have strtok_r+GIT_CHECK_FUNC(strtok_r,+[NO_STRTOK_R=],+[NO_STRTOK_R=YesPlease])+AC_SUBST(NO_STRTOK_R)+# # Define NO_MEMMEM if you don't have memmem. GIT_CHECK_FUNC(memmem, [NO_MEMMEM=],
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
dirent is #define’d to mingw_dirent in compat/mingw.h, with the
result that
obj_pool_gen(dirent, struct repo_dirent, 4096)
creates functions with names like mingw_dirent_alloc and
references to dirent_alloc go unresolved. Rename the functions
to dent_* to avoid this problem.
Reported-by: Johannes Sixt <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
vcs-svn/repo_tree.c | 146 +++++++++++++++++++++++++-------------------------
1 files changed, 73 insertions(+), 73 deletions(-)
@@ -30,7 +30,7 @@ struct repo_commit {/* Memory pools for commit, dir and dirent */obj_pool_gen(commit,structrepo_commit,4096)obj_pool_gen(dir,structrepo_dir,4096)-obj_pool_gen(dirent,structrepo_dirent,4096)+obj_pool_gen(dent,structrepo_dirent,4096)staticuint32_tactive_commit;staticuint32_tmark;
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
In the spirit of v1.6.4-rc0~124 (MinGW: Fix compiler warning in
merge-recursive, 2009-05-23), use a 32-bit integer instead; the
dump file parser does not support any better, anyway.
Signed-off-by: Jonathan Nieder <redacted>
---
vcs-svn/fast_export.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
Ever since v1.6.3-rc0~101^2~14 (Tests on Windows: $(pwd) must return
Windows-style paths, 2009-03-13), there is a subtle difference between
$(pwd) and $PWD in tests: the former returns Windows-style paths as
might be output by git and the latter Unix-style paths which msys
programs tend to prefer.
In file:// URIs, Unix-style paths are needed. Before: “svn export”
declares it cannot find
file://c:/apps/git/git/t/trash directory/simple-svco
After: “svn export” successfully finds
file:///c/apps/git/git/...
Signed-off-by: Jonathan Nieder <redacted>
---
t/t9010-svn-fe.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
The svn-fe test fails on Windows in the “svn export” step because of
the lack of symlink support. With a less ambitious dump, it passes.
Acked-by: Johannes Sixt <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
t/t9010-svn-fe.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: Chris Packham <hidden> Date: 2016-06-15 22:49:19
On 12/08/10 18:01, Ævar Arnfjörð Bjarmason wrote:
If it comes with its own perl it should also have a cpan shell:
perl -MCPAN -e 'install TAP::Harness::Archive'
That should be easier than installing strawberry in addition to the
mingw perl.
OK this is me officially giving up on windows (or at least this
particular windows box).
I couldn't install any perl modules with the environment provided by
msysgit, I couldn't make msys play nice with strawberry perl. In
desperation I tried cygwin and again I failed to get any perl modules
installed (although it did get further than msys).
I think a major part of the problem is the way the box was setup by the
IT department at work. It has its home drive set to a network share
which both cygwin and msys pick up on. This seems to cause problems for
the CPAN module when it tries to download and build stuff there.
I'd like to be able to help, but I lack the windows knowledge to change
any of the setup that was made by the IT team. If I get my hands on
another windows box with a more standard install I'll give it another
try. For now, I'm admitting defeat.
-C
On Sat, Aug 14, 2010 at 00:42, Chris Packham [off-list ref] wrote:
On 12/08/10 18:01, Ævar Arnfjörð Bjarmason wrote:
quoted
If it comes with its own perl it should also have a cpan shell:
perl -MCPAN -e 'install TAP::Harness::Archive'
That should be easier than installing strawberry in addition to the
mingw perl.
OK this is me officially giving up on windows (or at least this
particular windows box).
I couldn't install any perl modules with the environment provided by
msysgit, I couldn't make msys play nice with strawberry perl. In
desperation I tried cygwin and again I failed to get any perl modules
installed (although it did get further than msys).
I think a major part of the problem is the way the box was setup by the
IT department at work. It has its home drive set to a network share
which both cygwin and msys pick up on. This seems to cause problems for
the CPAN module when it tries to download and build stuff there.
I'd like to be able to help, but I lack the windows knowledge to change
any of the setup that was made by the IT team. If I get my hands on
another windows box with a more standard install I'll give it another
try. For now, I'm admitting defeat.
Thanks for trying. But since you have perl (but not any modules) I
might try to just produce some self-contained script that smokers can
drop in that has the needed Perl parts.
Can you try this though:
curl -L http://cpanmin.us | perl --self-upgrade -s
That should install cpanminus, then try to install the archive module.
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
Johannes Sixt wrote:
Am 13.08.2010 00:40, schrieb Jonathan Nieder:
quoted
Would this work?
-- 8< --
Subject: t4135 (apply): filenames with tabs are not usable on NTFS
[...]
No, it needs this squashed in
Ah, makes sense. Here’s another rough patch. Patch is against
jn/apply-filename-with-sp + ab/test. Not signed off because I am not
sure about the licensing of expand.sed (and I would rather see some
other fix instead).
-- 8< --
Subject: t4135 (apply): tweaks for Windows
Filenames with tabs are not usable on NTFS, so mimic the code setting
up the FUNNYNAMES prerequisite from v1.3.0-rc1~67 (workaround fat/ntfs
deficiences for t3600-rm.sh, 2006-03-03) and use it. The code is not
shared in test-lib.sh to avoid wasting time on that check while
running other tests.
Backslashes is the path separator on Windows, so it cannot be used
in filenames (see v1.6.3-rc0~93^2~6, t3700: Skip a test with
backslashes in pathspec, 2009-03-13).
Filenames starting with a quotation mark do not behave well in msys
(see v1.7.0-rc0~94^2, t4030, t4031: work around bogus MSYS bash path
conversion, 2010-01-01), so skip those tests on Windows.
“expand” is not available in msysgit. Use a sed script by Greg Ubben
to replace it.
Reported-by: Johannes Sixt <redacted>
Helped-by: Johannes Sixt [off-list ref]
Not-signed-off-by: Jonathan Nieder [off-list ref]
---
t/t4135-apply-weird-filenames.sh | 70 ++++++++++++++++++++++++++++++++------
1 files changed, 59 insertions(+), 11 deletions(-)
@@ -20,6 +20,44 @@ test_expect_success 'setup: clean-up functions' 'reset_subdirs(){rm-frab&&mkdirab+}&&++cat<<-\EOF>expand.sed&&+#! /bin/sed -f+# @(#)14apr89/31aug01 expand.sed by Greg Ubben++//!b++# Change the text before a tab to+# text<MARKER>text<TAB><8 blanks><TAB>+#+s/\([^]*\)/\1Q&/g++# Reduce the text between the marker and the tab to less+# than eight characters. We have to put in 8-(length MOD 8)+# blanks, and this effectively does the modulo operation.+:a+s/Q[^]\{8\}/Q/g+ta++# The buffer is now:+# text<MARKER><(length MOD 8) characters><TAB><expansion><extra blanks><TAB>+# -----------------------------------------+# Notice that the expansion is 8-(length MOD 8), so the+# underlined part is exactly nine characters. That is how+# we discard the extra blanks and the tabs.+#+s/\(Q.\{9\}\)*/\1/g++# We have now:+# text<MARKER><(length MOD 8) characters><TAB><expansion>+#+# so we discard everything between the marker and the tab+#+s/Q[^]*//g+EOF+expand_tabs(){+sed-f"$TRASH_DIRECTORY/expand.sed""$@"}'
@@ -57,7 +103,8 @@ try_filename() {test_cmppostimage.saved'$postimage'"-test_expect_$exp2UNIDIFF"$desc, traditional patch""+test_expect_$exp2${prereq:+$prereq,}UNIDIFF\+"$desc, traditional patch""reset_preimage&&echopreimage>'$postimage.orig'&&echopostimage>'$postimage'&&
@@ -70,7 +117,8 @@ try_filename() {test_cmppostimage.saved'$postimage'"-test_expect_$exp3FULLDIFF"$desc, traditional file creation patch""+test_expect_$exp3${prereq:+$prereq,}FULLDIFF\+"$desc, traditional file creation patch""reset_preimage&&reset_subdirs&&echopostimage>b/'$postimage'&&
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:49:19
Hi,
On Sat, Aug 14, 2010 at 8:42 AM, Chris Packham [off-list ref] wrote:
I couldn't install any perl modules with the environment provided by
msysgit, I couldn't make msys play nice with strawberry perl. In
desperation I tried cygwin
[snip]
On Sun, Aug 15, 2010 at 00:54, Tay Ray Chuan [off-list ref] wrote:
Hi,
On Sat, Aug 14, 2010 at 8:42 AM, Chris Packham [off-list ref] wrote:
quoted
I couldn't install any perl modules with the environment provided by
msysgit, I couldn't make msys play nice with strawberry perl. In
desperation I tried cygwin
[snip]
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:49:19
On Sun, Aug 15, 2010 at 9:08 AM, Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
Thanks, there's a bunch of failures though. Do those usually fail on
your Cygwin setup? I haven't looked at them in any detail.
Sorry, can't tell you much, as this is absolutely the first time I'm
running *all* the tests. Usually, I only run those that are likely to
be affected by the parts I hack.
--
Cheers,
Ray Chuan
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:20
Johannes Sixt wrote:
Why not just write an explicit test vector? The result of expand will be
constant, no?
Sorry for the long delay. Here's a re-roll, meant to replace
jn/apply-filename-with-sp from pu.
Patch 1 fixes an edge case for git apply -p when traditional patches
have quotation marks in file names (so: an edge case of an edge).
But that is only a side-effect; the main purpose is to rearrange
code to prepare for patch 3. Except for the commit message, it is
unchanged from the version in pu.
Patch 2 contains the funny-filenames tests. Testing on Windows would
be welcome. The test vectors are included in the patch to avoid a
source of non-determinism (for example, GNU diff could stop emiting
traditional patches some day). The script used to generate them is
provided to make the test easy to change.
Patch 3 is basically as before, except that find_name_traditional()
calls find_name_common() directly now instead of redundantly checking
again for quotes at the beginning of filenames. As before, the
purpose is to handle patches to files with whitespace in their
names, by trying to use the timestamp instead of arbitrary whitespace
as a name terminator (falling back to the old method if that fails).
Thanks for your help so far. The code would be much worse without it.
Jonathan Nieder (3):
apply: split quoted filename handling into new function
tests: exercise "git apply" with weird filenames
apply: handle traditional patches with space in filename
builtin/apply.c | 251 ++++++++++++++++++++++++++++++++------
t/t4120-apply-popt.sh | 35 +++++-
t/t4135-apply-weird-filenames.sh | 75 +++++++++++
t/t4135/.gitignore | 3 +
t/t4135/add-plain.diff | 5 +
t/t4135/add-with backslash.diff | 5 +
t/t4135/add-with quote.diff | 5 +
t/t4135/add-with spaces.diff | 5 +
t/t4135/add-with tab.diff | 5 +
t/t4135/damaged.diff | 5 +
t/t4135/diff-plain.diff | 5 +
t/t4135/diff-with backslash.diff | 5 +
t/t4135/diff-with quote.diff | 5 +
t/t4135/diff-with spaces.diff | 5 +
t/t4135/diff-with tab.diff | 5 +
t/t4135/git-plain.diff | 7 +
t/t4135/git-with backslash.diff | 7 +
t/t4135/git-with quote.diff | 7 +
t/t4135/git-with spaces.diff | 7 +
t/t4135/git-with tab.diff | 7 +
t/t4135/make-patches | 45 +++++++
21 files changed, 457 insertions(+), 42 deletions(-)
create mode 100755 t/t4135-apply-weird-filenames.sh
create mode 100644 t/t4135/.gitignore
create mode 100644 t/t4135/add-plain.diff
create mode 100644 t/t4135/add-with backslash.diff
create mode 100644 t/t4135/add-with quote.diff
create mode 100644 t/t4135/add-with spaces.diff
create mode 100644 t/t4135/add-with tab.diff
create mode 100644 t/t4135/damaged.diff
create mode 100644 t/t4135/diff-plain.diff
create mode 100644 t/t4135/diff-with backslash.diff
create mode 100644 t/t4135/diff-with quote.diff
create mode 100644 t/t4135/diff-with spaces.diff
create mode 100644 t/t4135/diff-with tab.diff
create mode 100644 t/t4135/git-plain.diff
create mode 100644 t/t4135/git-with backslash.diff
create mode 100644 t/t4135/git-with quote.diff
create mode 100644 t/t4135/git-with spaces.diff
create mode 100644 t/t4135/git-with tab.diff
create mode 100755 t/t4135/make-patches
--
1.7.2.1.544.ga752d.dirty
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:20
The new find_name_gnu() function handles new-style '--- "a/foo"'
patch header lines, leaving find_name() itself a bit less
daunting.
Functional change: do not clobber the p-value when there are not
enough path components in a quoted file name to honor it.
Signed-off-by: Jonathan Nieder <redacted>
---
builtin/apply.c | 70 +++++++++++++++++++++++++++---------------------
t/t4120-apply-popt.sh | 35 ++++++++++++++++++++++--
2 files changed, 71 insertions(+), 34 deletions(-)
@@ -416,44 +416,52 @@ static char *squash_slash(char *name)returnname;}+staticchar*find_name_gnu(constchar*line,char*def,intp_value)+{+structstrbufname=STRBUF_INIT;+char*cp;++/*+*Proposed"new-style"GNUpatch/diffformat;see+*http://marc.theaimsgroup.com/?l=git&m=112927316408690&w=2+*/+if(unquote_c_style(&name,line,NULL)){+strbuf_release(&name);+returnNULL;+}++for(cp=name.buf;p_value;p_value--){+cp=strchr(cp,'/');+if(!cp){+strbuf_release(&name);+returnNULL;+}+cp++;+}++/* name can later be freed, so we need+*tomemmove,notjustreturncp+*/+strbuf_remove(&name,0,cp-name.buf);+free(def);+if(root)+strbuf_insert(&name,0,root,root_len);+returnsquash_slash(strbuf_detach(&name,NULL));+}+staticchar*find_name(constchar*line,char*def,intp_value,intterminate){intlen;constchar*start=NULL;+if(*line=='"'){+char*name=find_name_gnu(line,def,p_value);+if(name)+returnname;+}+if(p_value==0)start=line;--if(*line=='"'){-structstrbufname=STRBUF_INIT;--/*-*Proposed"new-style"GNUpatch/diffformat;see-*http://marc.theaimsgroup.com/?l=git&m=112927316408690&w=2-*/-if(!unquote_c_style(&name,line,NULL)){-char*cp;--for(cp=name.buf;p_value;p_value--){-cp=strchr(cp,'/');-if(!cp)-break;-cp++;-}-if(cp){-/* name can later be freed, so we need-*tomemmove,notjustreturncp-*/-strbuf_remove(&name,0,cp-name.buf);-free(def);-if(root)-strbuf_insert(&name,0,root,root_len);-returnsquash_slash(strbuf_detach(&name,NULL));-}-}-strbuf_release(&name);-}-for(;;){charc=*line;
@@ -10,21 +10,50 @@ test_description='git apply -p handling.' test_expect_successsetup'mkdirsub&&echoA>sub/file1&&-cpsub/file1file1&&+cpsub/file1file1.saved&&gitaddsub/file1&&echoB>sub/file1&&gitdiff>patch.file&&-rmsub/file1&&-rmdirsub+gitcheckout--sub/file1&&+gitmvsubsüb&&+echoB>süb/file1&&+gitdiff>patch.escaped&&+grep"[\]"patch.escaped&&+rmsüb/file1&&+rmdirsüb' test_expect_success'apply git diff with -p2''+cpfile1.savedfile1&&gitapply-p2patch.file' test_expect_success'apply with too large -p''+cpfile1.savedfile1&&test_must_failgitapply--stat-p3patch.file2>err&&grep"removing 3 leading"err'+test_expect_success'apply (-p2) traditional diff with funny filenames''+cat>patch.quotes<<-\EOF&&+diff-u"a/"sub/file1"b/"sub/file1+---"a/"sub/file1++++"b/"sub/file1+@@-1+1@@+-A++B+EOF+echoB>expected&&++cpfile1.savedfile1&&+gitapply-p2patch.quotes&&+test_cmpexpectedfile1+'++test_expect_success'apply with too large -p and fancy filename''+cpfile1.savedfile1&&+test_must_failgitapply--stat-p3patch.escaped2>err&&+grep"removing 3 leading"err+'+ test_done
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:20
Check that "git apply" can cope with strange filenames, particularly
filenames with spaces.
Not all platforms have a sane enough diff -u and expand to
reliably create the such patches and maybe future versions of GNU
diff will handle funny characters differently, so this uses
pre-generated patches. The script used to generate them is in
t/t4135/make-patches.
Filenames with tabs are not usable on NTFS; use something like the
FUNNYNAMES prerequisite from v1.3.0-rc1~67 (2006-03-03) to skip the
relevant tests when appropriate. The detection is not shared in
test-lib.sh to avoid wasting time while running other test scripts.
Backslash is the path separator on Windows, so do not used it in
file names there (v1.6.3-rc0~93^2~6, 2009-03-13).
Finally, filenames starting with a quotation mark do not behave well
in msys (see v1.7.0-rc0~94^2, t4030, t4031: work around bogus MSYS
bash path conversion, 2010-01-01), so skip those tests on Windows,
too.
Helped-by: Andreas Schwab [off-list ref]
Helped-by: Johannes Sixt [off-list ref]
Signed-off-by: Jonathan Nieder <redacted>
---
t/t4135-apply-weird-filenames.sh | 75 ++++++++++++++++++++++++++++++++++++++
t/t4135/.gitignore | 3 ++
t/t4135/add-plain.diff | 5 +++
t/t4135/add-with backslash.diff | 5 +++
t/t4135/add-with quote.diff | 5 +++
t/t4135/add-with spaces.diff | 5 +++
t/t4135/add-with tab.diff | 5 +++
t/t4135/damaged.diff | 5 +++
t/t4135/diff-plain.diff | 5 +++
t/t4135/diff-with backslash.diff | 5 +++
t/t4135/diff-with quote.diff | 5 +++
t/t4135/diff-with spaces.diff | 5 +++
t/t4135/diff-with tab.diff | 5 +++
t/t4135/git-plain.diff | 7 ++++
t/t4135/git-with backslash.diff | 7 ++++
t/t4135/git-with quote.diff | 7 ++++
t/t4135/git-with spaces.diff | 7 ++++
t/t4135/git-with tab.diff | 7 ++++
t/t4135/make-patches | 45 +++++++++++++++++++++++
19 files changed, 213 insertions(+), 0 deletions(-)
create mode 100755 t/t4135-apply-weird-filenames.sh
create mode 100644 t/t4135/.gitignore
create mode 100644 t/t4135/add-plain.diff
create mode 100644 t/t4135/add-with backslash.diff
create mode 100644 t/t4135/add-with quote.diff
create mode 100644 t/t4135/add-with spaces.diff
create mode 100644 t/t4135/add-with tab.diff
create mode 100644 t/t4135/damaged.diff
create mode 100644 t/t4135/diff-plain.diff
create mode 100644 t/t4135/diff-with backslash.diff
create mode 100644 t/t4135/diff-with quote.diff
create mode 100644 t/t4135/diff-with spaces.diff
create mode 100644 t/t4135/diff-with tab.diff
create mode 100644 t/t4135/git-plain.diff
create mode 100644 t/t4135/git-with backslash.diff
create mode 100644 t/t4135/git-with quote.diff
create mode 100644 t/t4135/git-with spaces.diff
create mode 100644 t/t4135/git-with tab.diff
create mode 100755 t/t4135/make-patches
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:20
To discover filenames from the --- and +++ lines in a traditional
unified diff, currently "git apply" scans forward for a whitespace
character on each line and stops there. It can't use the whole line
because "diff -u" likes to include timestamps, like so:
--- foo 2000-07-12 16:56:50.020000414 -0500
+++ bar 2010-07-12 16:56:50.020000414 -0500
The whitespace-seeking heuristic works great, even when the tab
has been converted to spaces by some email + copy-and-paste
related corruption.
Except for one problem: if the filename itself contains whitespace,
the inferred filename will be too short.
When Giuseppe ran into this problem, it was for a file creation
patch (for debian/licenses/LICENSE.global BSD-style Chromium).
So one can't use the list of files present in the index to deduce an
appropriate filename (not to mention that way lies madness; see
v0.99~402, 2005-05-31).
Instead, look for a timestamp and use that if present to mark the end
of the filename. If no timestamp is present, the old heuristic is
used, with one exception: the space character \040 is not considered
terminating whitespace any more unless it is followed by a timestamp.
Reported-by: Giuseppe Iuculano <redacted>
Acked-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Jonathan Nieder <redacted>
---
Thanks for the helpful advice and patience at my use of it.
builtin/apply.c | 193 +++++++++++++++++++++++++++++++++++---
t/t4135-apply-weird-filenames.sh | 4 +-
2 files changed, 181 insertions(+), 16 deletions(-)
@@ -449,23 +449,157 @@ static char *find_name_gnu(const char *line, char *def, int p_value)returnsquash_slash(strbuf_detach(&name,NULL));}-staticchar*find_name(constchar*line,char*def,intp_value,intterminate)+staticsize_ttz_len(constchar*line,size_tlen)+{+constchar*tz,*p;++if(len<strlen(" +0500")||line[len-strlen(" +0500")]!=' ')+return0;+tz=line+len-strlen(" +0500");++if(tz[1]!='+'&&tz[1]!='-')+return0;++for(p=tz+2;p!=line+len;p++)+if(!isdigit(*p))+return0;++returnline+len-tz;+}++staticsize_tdate_len(constchar*line,size_tlen)+{+constchar*date,*p;++if(len<strlen("72-02-05")||line[len-strlen("-05")]!='-')+return0;+p=date=line+len-strlen("72-02-05");++if(!isdigit(*p++)||!isdigit(*p++)||*p++!='-'||+!isdigit(*p++)||!isdigit(*p++)||*p++!='-'||+!isdigit(*p++)||!isdigit(*p++))/* Not a date. */+return0;++if(date-line>=strlen("19")&&+isdigit(date[-1])&&isdigit(date[-2]))/* 4-digit year */+date-=strlen("19");++returnline+len-date;+}++staticsize_tshort_time_len(constchar*line,size_tlen)+{+constchar*time,*p;++if(len<strlen(" 07:01:32")||line[len-strlen(":32")]!=':')+return0;+p=time=line+len-strlen(" 07:01:32");++/* Permit 1-digit hours? */+if(*p++!=' '||+!isdigit(*p++)||!isdigit(*p++)||*p++!=':'||+!isdigit(*p++)||!isdigit(*p++)||*p++!=':'||+!isdigit(*p++)||!isdigit(*p++))/* Not a time. */+return0;++returnline+len-time;+}++staticsize_tfractional_time_len(constchar*line,size_tlen)+{+constchar*p;+size_tn;++/* Expected format: 19:41:17.620000023 */+if(!len||!isdigit(line[len-1]))+return0;+p=line+len-1;++/* Fractional seconds. */+while(p>line&&isdigit(*p))+p--;+if(*p!='.')+return0;++/* Hours, minutes, and whole seconds. */+n=short_time_len(line,p-line);+if(!n)+return0;++returnline+len-p+n;+}++staticsize_ttrailing_spaces_len(constchar*line,size_tlen)+{+constchar*p;++/* Expected format: ' ' x (1 or more) */+if(!len||line[len-1]!=' ')+return0;++p=line+len;+while(p!=line){+p--;+if(*p!=' ')+returnline+len-(p+1);+}++/* All spaces! */+returnlen;+}++staticsize_tdiff_timestamp_len(constchar*line,size_tlen)+{+constchar*end=line+len;+size_tn;++/*+*Posix:2010-07-0519:41:17+*GNU:2010-07-0519:41:17.620000023-0500+*/++if(!isdigit(end[-1]))+return0;++n=tz_len(line,end-line);+end-=n;++n=short_time_len(line,end-line);+if(!n)+n=fractional_time_len(line,end-line);+end-=n;++n=date_len(line,end-line);+if(!n)/* No date. Too bad. */+return0;+end-=n;++if(end==line)/* No space before date. */+return0;+if(end[-1]=='\t'){/* Success! */+end--;+returnline+len-end;+}+if(end[-1]!=' ')/* No space before date. */+return0;++/* Whitespace damage. */+end-=trailing_spaces_len(line,end-line);+returnline+len-end;+}++staticchar*find_name_common(constchar*line,char*def,intp_value,+constchar*end,intterminate){intlen;constchar*start=NULL;-if(*line=='"'){-char*name=find_name_gnu(line,def,p_value);-if(name)-returnname;-}-if(p_value==0)start=line;-for(;;){+while(line!=end){charc=*line;-if(isspace(c)){+if(!end&&isspace(c)){if(c=='\n')break;if(name_terminate(start,line-start,c,terminate))
@@ -505,6 +639,37 @@ static char *find_name(const char *line, char *def, int p_value, int terminate)returnsquash_slash(xmemdupz(start,len));}+staticchar*find_name(constchar*line,char*def,intp_value,intterminate)+{+if(*line=='"'){+char*name=find_name_gnu(line,def,p_value);+if(name)+returnname;+}++returnfind_name_common(line,def,p_value,NULL,terminate);+}++staticchar*find_name_traditional(constchar*line,char*def,intp_value)+{+size_tlen=strlen(line);+size_tdate_len;++if(*line=='"'){+char*name=find_name_gnu(line,def,p_value);+if(name)+returnname;+}++len=strchrnul(line,'\n')-line;+date_len=diff_timestamp_len(line,len);+if(!date_len)+returnfind_name_common(line,def,p_value,NULL,TERM_TAB);+len-=date_len;++returnfind_name_common(line,def,p_value,line+len,0);+}+staticintcount_slashes(constchar*cp){intcnt=0;
@@ -527,7 +692,7 @@ static int guess_p_value(const char *nameline)if(is_dev_null(nameline))return-1;-name=find_name(nameline,NULL,0,TERM_SPACE|TERM_TAB);+name=find_name_traditional(nameline,NULL,0);if(!name)return-1;cp=strchr(name,'/');