{"thread":{"id":"35226","subject":"What's cooking in git.git (Oct 2013, #07; Mon, 28)","startedAt":"2013-10-28T19:28:33Z","lastAt":"2013-11-13T12:20:20Z","messageCount":15,"participants":["Junio C Hamano","Thomas Rast","Torsten Bögershausen","Vicent Martí","Ramsay Jones","Jakub Narębski","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"229661","messageId":"xmqqr4b5dwke.fsf@gitster.dls.corp.google.com","threadId":"35226","inReplyTo":null,"subject":"What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-10-28T19:28:33Z","receivedAt":"2013-10-28T19:28:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here are the topics that have been cooking.  Commits prefixed with\n'-' are only in 'pu' (proposed updates) while commits prefixed with\n'+' are in 'next'.\n\nIt is already 10th week of this cycle, but somehow I completely\nforgot where in the cycle we were.  Sorry about that.\n\nI'll tag 1.8.5-rc0 in a few days by the end of this month, and then\nhopefully we will have two to three -rc weeks after that, aiming for\nthe final 1.8.5 release sometime late November (tentative schedule\nat http://tinyurl.com/gitCal).\n\nAs promised/requested, the final steps for 2.0 are in 'next'; they,\ntogether with a handful topics that have been merged to 'next'\nfairly recently, will _not_ be part of the upcoming 1.8.5 release,\nbut will be carried over in 'next' to the next cycle.\n\nAlso there is 1.8.4.2 maintenance release out.\n\nYou can find the changes described here in the integration branches\nof the repositories listed at\n\n    http://git-blame.blogspot.com/p/git-public-repositories.html\n\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* ew/keepalive (2013-10-16) 2 commits\n  (merged to 'next' on 2013-10-16 at 56fd9f3)\n + http: use curl's tcp keepalive if available\n  (merged to 'next' on 2013-10-14 at 24d786f)\n + http: enable keepalive on TCP sockets\n\n The HTTP transport will try to use TCP keepalive when able.\n\n\n* jc/revision-range-unpeel (2013-10-15) 1 commit\n  (merged to 'next' on 2013-10-16 at d04ddfe)\n + revision: do not peel tags used in range notation\n\n \"git rev-list --objects ^v1.0^ v1.0\" gave v1.0 tag itself in the\n output, but \"git rev-list --objects v1.0^..v1.0\" did not.\n\n\n* jk/remote-literal-string-leakfix (2013-10-15) 1 commit\n  (merged to 'next' on 2013-10-18 at 6abddac)\n + remote: do not copy \"origin\" string literal\n\n\n* jk/split-broken-ident (2013-10-15) 1 commit\n  (merged to 'next' on 2013-10-18 at 8f4b8b7)\n + split_ident: parse timestamp from end of line\n\n Make the fall-back parsing of commit objects with broken author or\n committer lines more robust to pick up the timestamps.\n\n\n* jx/relative-path-regression-fix (2013-10-14) 3 commits\n  (merged to 'next' on 2013-10-18 at b4af45f)\n + Use simpler relative_path when set_git_dir\n  (merged to 'next' on 2013-10-14 at 704b9ee)\n + relative_path should honor dos-drive-prefix\n + test: use unambigous leading path (/foo) for MSYS\n\n Will merge to 'master' and later to 'maint'.\n\n\n* sb/repack-in-c (2013-10-22) 1 commit\n  (merged to 'next' on 2013-10-23 at 5d7ac72)\n + Reword repack documentation to no longer state it's a script\n\n Finishing touches to update documentation.\n\n\n* sg/prompt-svn-remote-fix (2013-10-15) 1 commit\n  (merged to 'next' on 2013-10-18 at 20b47eb)\n + bash prompt: don't use '+=' operator in show upstream code path\n\n Bash portability fix.\n\n--------------------------------------------------\n[New Topics]\n\n* bw/solaris-sed-tr-test-portability (2013-10-28) 2 commits\n - Avoid difference in tr semantics between System V and BSD\n - Change sed i\\ usage to something Solaris' sed can handle\n\n Needs a bit of reroll.\n\n\n* fc/transport-helper-fixes (2013-10-28) 13 commits\n - test: remote-helper: add test for force pushes\n - git-remote-testgit: support the new 'force' option\n - fixup! transport-helper: add 'force' to 'export' helpers\n - transport-helper: don't update refs in dry-run\n - transport-helper: add support to delete branches\n - fast-export: add support to delete refs\n - fast-import: add support to delete refs\n - transport-helper: add support for old:new refspec\n - fast-export: add new --refspec option\n - fast-export: improve argument parsing\n - transport-helper: check for 'forced update' message\n - transport-helper: fix extra lines\n - transport-helper: add 'force' to 'export' helpers\n\n\n\n* jh/loose-object-dirs-creation-race (2013-10-28) 1 commit\n - sha1_file.c:create_tmpfile(): Fix race when creating loose object dirs\n\n\n* js/test-help-format-windows-port-fix (2013-10-28) 1 commit\n - PATCH] t3200: do not open a HTML manual page when DEFAULT_MAN_FORMAT is html\n\n Will merge to 'next' after amending the title.\n\n\n* js/tests-windows-port-fix (2013-10-28) 3 commits\n - tests: undo special treatment of CRLF for Windows\n - Windows: a test_cmp that is agnostic to random LF <> CRLF conversions\n - t5300-pack-object: do not compare binary data using test_cmp\n\n Will merge to 'next'.\n\n\n* nd/liteal-pathspecs (2013-10-28) 1 commit\n - pathspec: stop --*-pathspecs impact on internal parse_pathspec() uses\n\n\n* rs/web-browse-xdg-open (2013-10-28) 1 commit\n - web--browse: Add support for xdg-open.\n\n Will merge to 'next'.\n\n\n* sb/refs-code-cleanup (2013-10-28) 2 commits\n - cache: remove unused function 'have_git_dir'\n - refs: remove unused function invalidate_ref_cache\n\n Will merge to 'next'.\n\n\n* th/reflog-annotated-tag (2013-10-28) 1 commit\n - reflog: handle lightweight and annotated tags equally\n\n--------------------------------------------------\n[Stalled]\n\n* np/pack-v4 (2013-09-18) 90 commits\n . packv4-parse.c: add tree offset caching\n . t1050: replace one instance of show-index with verify-pack\n . index-pack, pack-objects: allow creating .idx v2 with .pack v4\n . unpack-objects: decode v4 trees\n . unpack-objects: allow to save processed bytes to a buffer\n - ...\n\n Nico and Duy advancing the eternal vaporware pack-v4.  This is here\n primarily for wider distribution of the preview edition.\n\n Temporarily ejected from 'pu', to try out jk/pack-bitmap, which\n this topic conflicts with.\n\n\n* sc/doc-howto-dumb-http (2013-10-16) 1 commit\n . doc/howto: warn about (dumb)http server document being too old\n\n The new text needs to go somewhere in the body of the document,\n not before the title line.\n\n\n* tg/perf-lib-test-perf-cleanup (2013-09-19) 2 commits\n - perf-lib: add test_perf_cleanup target\n - perf-lib: split starting the test from the execution\n\n Add test_perf_cleanup shell function to the perf suite, that allows\n the script writers to define a test with a clean-up action.\n\n Holding until needed.\n\n\n* yt/shortened-rename (2013-10-18) 2 commits\n - SQUASH??? style fixes and s/omit/shorten/ where appropriate\n - diff.c: keep arrow(=>) on show_stats()'s shortened filename part to make rename visible\n\n Attempts to give more weight on the fact that a filepair represents\n a rename than showing substring of the actual path when diffstat\n lines are not wide enough.\n\n I am not sure if that is solving a right problem, though.\n\n\n* jc/ref-excludes (2013-09-03) 2 commits\n - document --exclude option\n - revision: introduce --exclude=<glob> to tame wildcards\n\n People often wished a way to tell \"git log --branches\" (and \"git\n log --remotes --not --branches\") to exclude some local branches\n from the expansion of \"--branches\" (similarly for \"--tags\", \"--all\"\n and \"--glob=<pattern>\").  Now they have one.\n\n Needs a matching change to rev-parse.\n\n\n* rv/send-email-cache-generated-mid (2013-08-21) 2 commits\n - git-send-email: Cache generated message-ids, use them when prompting\n - git-send-email: add optional 'choices' parameter to the ask sub\n\n\n* rj/read-default-config-in-show-ref-pack-refs (2013-06-17) 3 commits\n - ### DONTMERGE: needs better explanation on what config they need\n - pack-refs.c: Add missing call to git_config()\n - show-ref.c: Add missing call to git_config()\n\n The changes themselves are probably good, but it is unclear what\n basic setting needs to be read for which exact operation.\n\n Waiting for clarification.\n $gmane/228294\n\n\n* jc/format-patch (2013-04-22) 2 commits\n - format-patch: --inline-single\n - format-patch: rename \"no_inline\" field\n\n A new option to send a single patch to the standard output to be\n appended at the bottom of a message.  I personally have no need for\n this, but it was easy enough to cobble together.  Tests, docs and\n stripping out more MIMEy stuff are left as exercises to interested\n parties.\n\n\n* jk/gitweb-utf8 (2013-04-08) 4 commits\n - gitweb: Fix broken blob action parameters on blob/commitdiff pages\n - gitweb: Don't append ';js=(0|1)' to external links\n - gitweb: Make feed title valid utf8\n - gitweb: Fix utf8 encoding for blob_plain, blobdiff_plain, commitdiff_plain, and patch\n\n Various fixes to gitweb.\n\n Drew Northup volunteered to take a look into this.\n $gmane/226216\n\n\n* jc/show-branch (2013-06-07) 5 commits\n - show-branch: use commit slab to represent bitflags of arbitrary width\n - show-branch.c: remove \"all_mask\"\n - show-branch.c: abstract out \"flags\" operation\n - show-branch.c: lift all_mask/all_revs to a global static\n - show-branch.c: update comment style\n\n Waiting for the final step to lift the hard-limit before sending it out.\n\n--------------------------------------------------\n[Cooking]\n\n* tr/merge-recursive-index-only (2013-10-28) 3 commits\n - merge-recursive: -Xindex-only to leave worktree unchanged\n - merge-recursive: internal flag to avoid touching the worktree\n - merge-recursive: remove dead conditional in update_stages()\n\n Holding until there is a caller to learn from.\n\n\n* bc/http-100-continue (2013-10-28) 1 commit\n - remote-curl: fix large pushes with GSSAPI\n\n Conditionally allow \"100 Continue\" responses to help use of\n GSS-Negotiate authentication scheme over HTTP transport.\n\n Rerolled. Is everybody happy with this version without\n configuration?\n\n\n* jc/merge-base-reflog (2013-10-28) 2 commits\n - merge-base: teach \"--fork-point\" mode\n - merge-base: use OPT_CMDMODE and clarify the command line parsing\n\n Code the logic in \"pull --rebase\" that figures out a fork point\n from reflog entries in C.\n\n Rerolled.\n\n\n* jk/date-c-double-semicolon (2013-10-24) 1 commit\n  (merged to 'next' on 2013-10-28 at 00ce440)\n + drop redundant semicolon in empty while\n\n Will merge to 'master'.\n\n\n* jk/for-each-ref-skip-parsing (2013-10-24) 1 commit\n - for-each-ref: avoid loading objects to print %(objectname)\n\n Will merge to 'next' and then to 'master'.\n\n\n* jk/pack-bitmap (2013-10-28) 20 commits\n - count-objects: consider .bitmap without .pack/.idx pair garbage\n - pack-bitmap: implement optional name_hash cache\n - t: add basic bitmap functionality tests\n - repack: consider bitmaps when performing repacks\n - repack: handle optional files created by pack-objects\n - repack: turn exts array into array-of-struct\n - repack: stop using magic number for ARRAY_SIZE(exts)\n - pack-objects: implement bitmap writing\n - rev-list: add bitmap mode to speed up object lists\n - pack-objects: use bitmaps when packing objects\n - pack-bitmap: add support for bitmap indexes\n - documentation: add documentation for the bitmap format\n - ewah: compressed bitmap implementation\n - compat: add endianness helpers\n - sha1_file: export `git_open_noatime`\n - revision: allow setting custom limiter function\n - pack-objects: factor out name_hash\n - pack-objects: refactor the packing list\n - revindex: export new APIs\n - sha1write: make buffer const-correct\n\n Borrows the bitmap index into packfiles from JGit to speed up\n enumeration of objects involved in a commit range without having to\n fully traverse the history.\n\n\n* jk/refs-c-squelch-gcc (2013-10-24) 1 commit\n  (merged to 'next' on 2013-10-28 at d15f7c2)\n + silence gcc array-bounds warning\n\n Will merge to 'master'.\n\n\n* jk/robustify-parse-commit (2013-10-24) 6 commits\n - checkout: do not die when leaving broken detached HEAD\n - use parse_commit_or_die instead of custom message\n - use parse_commit_or_die instead of segfaulting\n - assume parse_commit checks for NULL commit\n - assume parse_commit checks commit->object.parsed\n - log_tree_diff: die when we fail to parse a commit\n\n Will merge to 'next' after taking another look.\n\n\n* mh/fetch-tags-in-addition-to-normal-refs (2013-10-24) 16 commits\n - fetch, remote: properly convey --no-prune options to subprocesses\n - builtin/remote.c:update(): use struct argv_array\n - builtin/remote.c: reorder function definitions\n - query_refspecs(): move some constants out of the loop\n - fetch --prune: prune only based on explicit refspecs\n - SQUASH??? --tags is no longer a short-hand\n - fetch --tags: fetch tags *in addition to* other stuff\n - builtin/fetch.c: reorder function definitions\n - ref_remove_duplicates(): improve documentation comment\n - ref_remove_duplicates(): simplify function\n - ref_remove_duplicates(): avoid redundant bisection\n - get_ref_map(): rename local variables\n - api-remote.txt: correct section \"struct refspec\"\n - t5510: check that \"git fetch --prune --tags\" does not prune branches\n - t5510: prepare test refs more straightforwardly\n - t5510: use the correct tag name in test\n\n Some questionable paragraphs in the doc updates, but other than\n that looks reasonably solid.\n\n Expecting a reroll.\n\n\n* nd/lift-path-max (2013-10-24) 2 commits\n  (merged to 'next' on 2013-10-28 at 07698af)\n + checkout_entry(): clarify the use of topath[] parameter\n + entry.c: convert checkout_entry to use strbuf\n\n Will merge to 'master'.\n\n\n* jk/pack-corruption-post-mortem (2013-10-25) 1 commit\n - howto: add article on recovering a corrupted object\n\n Will merge to 'next' and then to 'master'.\n\n\n* jk/reset-p-current-head-fix (2013-10-25) 2 commits\n - reset: pass real rev name to add--interactive\n - add-interactive: handle unborn branch in patch mode\n\n \"git reset -p HEAD\" has codepath to special case it from resetting\n to contents of other commits, but recent change broke it.\n\n Will merge to 'next' and then to 'master'.\n\n\n* mf/graph-show-root (2013-10-25) 1 commit\n - graph.c: mark root commit differently\n\n In a repository with multiple-roots, \"log --graph\", especially with\n \"--oneline\", does not give the reader enough visual cue to see\n where one line of history ended and a separate history began.\n\n This is the version that marks the roots 'x' when they would have\n been marked as '*'; Keshav Kini suggested an alternative of giving\n an extra blank line after every root, which I tend to think is a\n better approach to the problem.\n\n\n* nv/parseopt-opt-arg (2013-10-25) 1 commit\n - rev-parse --parseopt: add the --sticked-long mode\n\n Enhance \"rev-parse --parseopt\" mode to help parsing options with\n an optional parameter.\n\n Option name bikeshedding aside (\"Is it sticked or stuck?\"), the\n change seems to be competently done.\n\n\n* ap/remote-hg-unquote-cquote (2013-10-23) 1 commit\n  (merged to 'next' on 2013-10-28 at 6b99fd5)\n + remote-hg: unquote C-style paths when exporting\n\n A fast-import stream expresses a pathname with funny characters by\n quoting them in C style; remote-hg remote helper forgot to unquote\n such a path.\n\n Will merge to 'next'.\n\n\n* jl/pack-transfer-avoid-double-close (2013-10-23) 1 commit\n  (merged to 'next' on 2013-10-28 at 4a55bba)\n + Clear fd after closing to avoid double-close error\n\n The codepath that send_pack() calls pack_objects() mistakenly\n closed the same file descriptor twice, leading to potentially\n closing a wrong file descriptor that was opened in the meantime.\n\n Will merge to 'master' and later to 'maint'.\n\n\n* nd/magic-pathspec (2013-10-22) 1 commit\n  (merged to 'next' on 2013-10-28 at 50eda68)\n + Fix calling parse_pathspec with no paths nor PATHSPEC_PREFER_* flags\n\n All callers to parse_pathspec() must choose between getting no\n pathspec or one path that is limited to the current directory\n when there is no paths given on the command line, but there were\n two callers that violated this rule, triggering a BUG().\n\n Will merge to 'master'.\n\n\n* sb/git-svn-docs-indent-with-ht (2013-10-22) 1 commit\n  (merged to 'next' on 2013-10-28 at 8a952d1)\n + git-svn docs: Use tabs consistently within the ascii doc\n\n Will merge to 'master'.\n\n\n* tr/gitk-doc-update (2013-10-22) 1 commit\n  (merged to 'next' on 2013-10-28 at f4158b8)\n + Documentation: revamp gitk(1)\n\n Will merge to 'master'.\n\n\n* tr/valgrind-test-fix (2013-10-22) 2 commits\n  (merged to 'next' on 2013-10-28 at 4d3f31a)\n + Revert \"test-lib: allow prefixing a custom string before \"ok N\" etc.\"\n + Revert \"test-lib: support running tests under valgrind in parallel\"\n\n Will merge to 'master'.\n\n\n* mm/checkout-auto-track-fix (2013-10-18) 2 commits\n  (merged to 'next' on 2013-10-28 at f4594ba)\n + checkout: proper error message on 'git checkout foo bar --'\n + checkout: allow dwim for branch creation for \"git checkout $branch --\"\n\n \"git checkout topic\", when there is not yet a local \"topic\" branch\n but there is a unique remote-tracking branch for a remote \"topic\"\n branch, pretended as if \"git checkout -t -b topic remote/$r/topic\"\n (for that unique remote $r) was run. This hack however was not\n implemented for \"git checkout topic --\".\n\n Will merge to 'master'.\n\n\n* hn/log-graph-color-octopus (2013-10-18) 1 commit\n  (merged to 'next' on 2013-10-28 at e103175)\n + graph: fix coloring around octopus merges\n\n Will merge to 'master'.\n\n\n* nd/gc-lock-against-each-other (2013-10-18) 1 commit\n  (merged to 'next' on 2013-10-28 at 14bd458)\n + gc: remove gc.pid file at end of execution\n\n Will merge to 'master'.\n\n\n* fc/styles (2013-10-16) 7 commits\n  (merged to 'next' on 2013-10-28 at cf592ed)\n + block-sha1/sha1.c: have SP around arithmetic operators\n + base85.c: have SP around arithmetic operators\n + archive.c: have SP around arithmetic operators\n + alloc.c: have SP around arithmetic operators\n + abspath.c: have SP around arithmetic operators\n + alias: have SP around arithmetic operators\n + C: have space around && and || operators\n\n C coding style fixes.\n\n Will merge to 'master'.\n\n\n* sg/t3600-nul-sha1-fix (2013-10-16) 1 commit\n  (merged to 'next' on 2013-10-28 at ac4b703)\n + t3600: fix broken \"choking git rm\" test\n\n Will merge to 'master'.\n\n\n* ak/submodule-foreach-quoting (2013-09-27) 1 commit\n  (merged to 'next' on 2013-10-14 at d77c5f1)\n + submodule foreach: skip eval for more than one argument\n\n A behavior change, but a worthwhile one: \"git submodule foreach\"\n was treating its arguments as part of a single command to be\n concatenated and passed to a shell, making writing buggy\n scripts too easy.\n\n This patch preserves the old \"just pass it to the shell\" behavior\n when a single argument is passed to 'git submodule foreach' and\n moves to a new \"skip the shell and use the arguments passed\n unmolested\" behavior when more than one argument is passed.\n\n The old behavior (always concatenating and passing to the shell)\n was similar to the 'ssh' command, while the new behavior (switching\n on the number of arguments) is what 'xterm -e' does.\n\n May need more thought to make sure this change is advertised well\n so that scripts that used multiple arguments but added their own\n extra layer of quoting are not broken.\n\n Will cook in 'next' for the rest of this cycle.\n\n\n* jk/http-auth-redirects (2013-10-24) 10 commits\n  (merged to 'next' on 2013-10-24 at 4bebb66)\n + http.c: Spell the null pointer as NULL\n + remote-curl: rewrite base url from info/refs redirects\n + remote-curl: store url as a strbuf\n + remote-curl: make refs_url a strbuf\n + http: update base URLs when we see redirects\n + http: provide effective url to callers\n + http: hoist credential request out of handle_curl_result\n  (merged to 'next' on 2013-10-14 at a0642be)\n + http: refactor options to http_get_*\n + http_request: factor out curlinfo_strbuf\n + http_get_file: style fixes\n\n Handle the case where http transport gets redirected during the\n authorization request better.\n\n Will merge to 'master'.\n\n\n* jl/submodule-mv (2013-10-13) 1 commit\n  (merged to 'next' on 2013-10-28 at 8dc9b31)\n + mv: Fix spurious warning when moving a file in presence of submodules\n\n Moving a regular file in a repository with a .gitmodules file was\n producing a warning 'Could not find section in .gitmodules where\n path=<filename>'.\n\n Will merge to 'master'.\n\n\n* kb/fast-hashmap (2013-10-22) 12 commits\n - remove old hash.[ch] implementation\n - read-cache.c: fix memory leaks caused by removed cache entries\n - name-hash.c: remove cache entries instead of marking them CE_UNHASHED\n - name-hash.c: use new hash map implementation for cache entries\n - name-hash.c: remove unreferenced directory entries\n - name-hash.c: use new hash map implementation for directories\n - diffcore-rename.c: use new hash map implementation\n - diffcore-rename.c: simplify finding exact renames\n - diffcore-rename.c: move code around to prepare for the next patch\n - buitin/describe.c: use new hash map implementation\n - add a hashtable implementation that supports O(1) removal\n - submodule: don't access the .gitmodules cache entry after removing it\n\n Improvements to our hash table to get it to meet the needs of the\n msysgit fscache project, with some nice performance improvements.\n\n The preparatory clean-up to submodule from Jens is at the bottom. I\n also squashed in a fix-up by Karsten found at $gmane/236468 (please\n double-check the result).\n\n Will merge to 'next'.\n\n\n* jc/upload-pack-send-symref (2013-10-22) 10 commits\n  (merged to 'next' on 2013-10-23 at 8ef5660)\n + t5570: Update for clone-progress-to-stderr branch\n + Merge branch 'jk/clone-progress-to-stderr' into jc/upload-pack-send-symref\n + t5570: Update for symref capability\n  (merged to 'next' on 2013-10-16 at eb1ae25)\n + clone: test the new HEAD detection logic\n + connect: annotate refs with their symref information in get_remote_head()\n + connect.c: make parse_feature_value() static\n + upload-pack: send non-HEAD symbolic refs\n + upload-pack: send symbolic ref information as capability\n + upload-pack.c: do not pass confusing cb_data to mark_our_ref()\n + t5505: fix \"set-head --auto with ambiguous HEAD\" test\n\n One long-standing flaw in the pack transfer protocol used by \"git\n clone\" was that there was no way to tell the other end which branch\n \"HEAD\" points at, and the receiving end needed to guess.  A new\n capability has been defined in the pack protocol to convey this\n information so that cloning from a repository with more than one\n branches pointing at the same commit where the HEAD is at now\n reliably sets the initial branch in the resulting repository.\n\n Will merge to 'master'.\n\n\n* jn/add-2.0-u-A-sans-pathspec (2013-04-26) 1 commit\n  (merged to 'next' on 2013-10-28 at d8cdf30)\n + git add: -u/-A now affects the entire working tree\n\n Will cook in 'next' until Git 2.0.\n\n\n* jc/core-checkstat-2.0 (2013-05-06) 1 commit\n  (merged to 'next' on 2013-10-28 at f1bec96)\n + core.statinfo: remove as promised in Git 2.0\n\n Will cook in 'next' until Git 2.0.\n\n\n* jc/push-2.0-default-to-simple (2013-06-18) 1 commit\n  (merged to 'next' on 2013-10-28 at 3153a9e)\n + push: switch default from \"matching\" to \"simple\"\n\n Will cook in 'next' until Git 2.0.\n\n\n* jc/add-2.0-ignore-removal (2013-04-22) 1 commit\n  (merged to 'next' on 2013-10-28 at 5fd76ec)\n + git add <pathspec>... defaults to \"-A\"\n\n Updated endgame for \"git add <pathspec>\" that defaults to \"--all\"\n aka \"--no-ignore-removal\".\n\n Will cook in 'next' until Git 2.0.\n\n\n* jc/hold-diff-remove-q-synonym-for-no-deletion (2013-07-19) 1 commit\n - diff: remove \"diff-files -q\" in a version of Git in a distant future\n\n Will merge to and cook in 'next' until a distant future.\n\n--------------------------------------------------\n[Discarded]\n\n* jh/shorten-refname (2013-05-07) 4 commits\n . t1514: refname shortening is done after dereferencing symbolic refs\n . shorten_unambiguous_ref(): Fix shortening refs/remotes/origin/HEAD to origin\n . t1514: Demonstrate failure to correctly shorten \"refs/remotes/origin/HEAD\"\n . t1514: Add tests of shortening refnames in strict/loose mode\n\n When remotes/origin/HEAD is not a symbolic ref, \"rev-parse\n --abbrev-ref remotes/origin/HEAD\" ought to show \"origin\", not\n \"origin/HEAD\", which is fixed with this series (if it is a symbolic\n ref that points at remotes/origin/something, then it should show\n \"origin/something\" and it already does).\n\n Has been expecting a reroll, as an early part of a larger series.\n $gmane/225137\n\n Discarded due to inactivity, without prejudice.\n"},{"id":"229678","messageId":"87k3gxkqgg.fsf@linux-k42r.v.cablecom.net","threadId":"35226","inReplyTo":"xmqqr4b5dwke.fsf@gitster.dls.corp.google.com","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Thomas Rast","fromEmail":"tr@thomasrast.ch","sentAt":"2013-10-28T21:58:39Z","receivedAt":"2013-10-28T21:58:39Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Hi Karsten\n\nJunio C Hamano <gitster@pobox.com> writes:\n\n> * kb/fast-hashmap (2013-10-22) 12 commits\n>  - remove old hash.[ch] implementation\n>  - read-cache.c: fix memory leaks caused by removed cache entries\n\nI found more valgrind breakage related to this commit, in t2101.[3567]\n(sorry for only reporting them so late, I probably missed them in the\nlast run).  E.g. I get this:\n\n  $ ./t2101-update-index-reupdate.sh --valgrind-only=3\n  ok 1 - update-index --add\n  ok 2 - update-index --again\n\n  expecting success: git update-index --remove --again &&\n           git ls-files -s >current &&\n           cmp current expected\n  ==21665== Invalid read of size 1\n  ==21665==    at 0x4C2C762: __GI_strlen (mc_replace_strmem.c:405)\n  ==21665==    by 0x484B0E: update_one (update-index.c:305)\n  ==21665==    by 0x485466: do_reupdate (update-index.c:582)\n  ==21665==    by 0x4858FB: reupdate_callback (update-index.c:696)\n  ==21665==    by 0x4EB5E7: get_value (parse-options.c:96)\n  ==21665==    by 0x4EBEC5: parse_long_opt (parse-options.c:302)\n  ==21665==    by 0x4EC5CD: parse_options_step (parse-options.c:474)\n  ==21665==    by 0x486115: cmd_update_index (update-index.c:824)\n  ==21665==    by 0x405999: run_builtin (git.c:314)\n  ==21665==    by 0x405B2C: handle_internal_command (git.c:477)\n  ==21665==    by 0x405C46: run_argv (git.c:523)\n  ==21665==    by 0x405DE2: main (git.c:606)\n  ==21665==  Address 0x5bee774 is 84 bytes inside a block of size 90 free'd\n  ==21665==    at 0x4C2ACDA: free (vg_replace_malloc.c:468)\n  ==21665==    by 0x4F9360: remove_index_entry_at (read-cache.c:482)\n  ==21665==    by 0x4F9536: remove_file_from_index (read-cache.c:522)\n  ==21665==    by 0x4841DF: remove_one_path (update-index.c:68)\n  ==21665==    by 0x48422E: process_lstat_error (update-index.c:83)\n  ==21665==    by 0x4846BB: process_path (update-index.c:211)\n  ==21665==    by 0x484AC2: update_one (update-index.c:301)\n  ==21665==    by 0x485466: do_reupdate (update-index.c:582)\n  ==21665==    by 0x4858FB: reupdate_callback (update-index.c:696)\n  ==21665==    by 0x4EB5E7: get_value (parse-options.c:96)\n  ==21665==    by 0x4EBEC5: parse_long_opt (parse-options.c:302)\n  ==21665==    by 0x4EC5CD: parse_options_step (parse-options.c:474)\n  [...]\n  not ok 3 - update-index --remove --again\n  #       git update-index --remove --again &&\n  #                git ls-files -s >current &&\n  #                cmp current expected\n\n  ok 4 - first commit\n  ok 5 - update-index again\n  ok 6 - update-index --update from subdir\n  ok 7 - update-index --update with pathspec\n  # failed 1 among 7 test(s)\n  1..7\n\nThe errors for tests 5-7 look like they're the same piece of code\nbreaking.\n\n-- \nThomas Rast\ntr@thomasrast.ch\n"},{"id":"229829","messageId":"5271392E.8020003@web.de","threadId":"35226","inReplyTo":"xmqqr4b5dwke.fsf@gitster.dls.corp.google.com","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-10-30T16:51:58Z","receivedAt":"2013-10-30T16:51:58Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-10-28 20.28, Junio C Hamano wrote:\n> * jk/pack-bitmap (2013-10-28) 20 commits\nThere is a name clash under cygwin 1.7 (1.5 is OK)\nThe following \"first aid hot fix\" works for me:\n/Torsten\n\n$ git diff\ndiff --git a/compat/bswap.h b/compat/bswap.h\nindex ea1a9ed..8dc39be 100644\n--- a/compat/bswap.h\n+++ b/compat/bswap.h\n@@ -64,7 +64,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n #      if defined(__GNUC__) && defined(__GLIBC__)\n #              include <byteswap.h>\n #      else /* GNUC & GLIBC */\n-static inline uint64_t bswap_64(uint64_t val)\n+static inline uint64_t git_bswap_64(uint64_t val)\n {\n        return ((val & (uint64_t)0x00000000000000ffULL) << 56)\n                | ((val & (uint64_t)0x000000000000ff00ULL) << 40)\n@@ -76,8 +76,8 @@ static inline uint64_t bswap_64(uint64_t val)\n                | ((val & (uint64_t)0xff00000000000000ULL) >> 56);\n }\n #      endif /* GNUC & GLIBC */\n-#      define ntohll(n) bswap_64(n)\n-#      define htonll(n) bswap_64(n)\n+#      define ntohll(n) git_bswap_64(n)\n+#      define htonll(n) git_bswap_64(n)\n #else /* __BYTE_ORDER */\n #      error \"Can't define htonll or ntohll!\"\n #endif\n"},{"id":"229830","messageId":"CAFFjANT=-mQoKUU2KsPHo3Hcq7RAuyM1t4kvJu4OfiNeHrA+Ng@mail.gmail.com","threadId":"35226","inReplyTo":"5271392E.8020003@web.de","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Vicent Martí","fromEmail":"tanoku@gmail.com","sentAt":"2013-10-30T17:01:16Z","receivedAt":"2013-10-30T17:01:16Z","isPatch":false,"sender":{"key":"tanoku@gmail.com","avatar":"https://gravatar.com/avatar/271386991cb4c2b8f1e1ed1d059f3422cc3485de7a598f65043f70be021d095b?d=mp&s=160"},"body":"On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n> There is a name clash under cygwin 1.7 (1.5 is OK)\n> The following \"first aid hot fix\" works for me:\n> /Torsten\n\nIf Cygwin declares its own bswap_64, wouldn't it be better to use it\ninstead of overwriting it with our own?\n"},{"id":"229834","messageId":"52713E67.3000202@web.de","threadId":"35226","inReplyTo":"CAFFjANT=-mQoKUU2KsPHo3Hcq7RAuyM1t4kvJu4OfiNeHrA+Ng@mail.gmail.com","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-10-30T17:14:15Z","receivedAt":"2013-10-30T17:14:15Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-10-30 18.01, Vicent Martí wrote:\n> On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>> There is a name clash under cygwin 1.7 (1.5 is OK)\n>> The following \"first aid hot fix\" works for me:\n>> /Torsten\n> \n> If Cygwin declares its own bswap_64, wouldn't it be better to use it\n> instead of overwriting it with our own?\nYes,\nthis will be part of a longer patch.\nI found that some systems have something like this:\n\n#define htobe64(x) bswap_64(x)\nAnd bswap_64 is a function, so we can not detect it by \"asking\"\n#ifdef bswap_64\n..\n#endif\n\n\nBut we can use\n#ifdef htobe64\n...\n#endif\nand this will be part of a bigger patch.\n\nAnd, in general, we should avoid to introduce functions which may have a\nname clash.\nUsing the git_ prefix for function names is a good practice.\nSo in order to unbrake the compilation error under cygwin 17,\nthe \"hotfix\" can be used.\n/Torsten\n"},{"id":"229840","messageId":"5271443D.3070402@web.de","threadId":"35226","inReplyTo":"52713E67.3000202@web.de","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-10-30T17:39:09Z","receivedAt":"2013-10-30T17:39:09Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-10-30 18.14, Torsten Bögershausen wrote:\n> On 2013-10-30 18.01, Vicent Martí wrote:\n>> On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>>> There is a name clash under cygwin 1.7 (1.5 is OK)\n>>> The following \"first aid hot fix\" works for me:\n>>> /Torsten\n>>\n>> If Cygwin declares its own bswap_64, wouldn't it be better to use it\n>> instead of overwriting it with our own?\n> Yes,\n> this will be part of a longer patch.\n> I found that some systems have something like this:\n> \n> #define htobe64(x) bswap_64(x)\n> And bswap_64 is a function, so we can not detect it by \"asking\"\n> #ifdef bswap_64\n> ..\n> #endif\n> \n> \n> But we can use\n> #ifdef htobe64\n> ...\n> #endif\n> and this will be part of a bigger patch.\n> \n> And, in general, we should avoid to introduce functions which may have a\n> name clash.\n> Using the git_ prefix for function names is a good practice.\n> So in order to unbrake the compilation error under cygwin 17,\n> the \"hotfix\" can be used.\n> /Torsten\nI just realized that there seem to problems to compile pu under msysgit.\nMore investigation needed here.\n"},{"id":"229851","messageId":"527158AF.3070204@ramsay1.demon.co.uk","threadId":"35226","inReplyTo":"52713E67.3000202@web.de","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-10-30T19:06:23Z","receivedAt":"2013-10-30T19:06:23Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 30/10/13 17:14, Torsten Bögershausen wrote:\n> On 2013-10-30 18.01, Vicent Martí wrote:\n>> On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>>> There is a name clash under cygwin 1.7 (1.5 is OK)\n>>> The following \"first aid hot fix\" works for me:\n>>> /Torsten\n>>\n>> If Cygwin declares its own bswap_64, wouldn't it be better to use it\n>> instead of overwriting it with our own?\n> Yes,\n> this will be part of a longer patch.\n> I found that some systems have something like this:\n> \n> #define htobe64(x) bswap_64(x)\n> And bswap_64 is a function, so we can not detect it by \"asking\"\n> #ifdef bswap_64\n> ..\n> #endif\n> \n> \n> But we can use\n> #ifdef htobe64\n> ...\n> #endif\n> and this will be part of a bigger patch.\n> \n> And, in general, we should avoid to introduce functions which may have a\n> name clash.\n> Using the git_ prefix for function names is a good practice.\n> So in order to unbrake the compilation error under cygwin 17,\n> the \"hotfix\" can be used.\n\nheh, my patch (given below) took a different approach, but ....\n\nATB,\nRamsay Jones\n\n-- >8 --\nSubject: [PATCH] compat/bswap.h: Fix redefinition of bswap_64 error on cygwin\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nSince commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\nthe cygwin build has failed like so:\n\n    GIT_VERSION = 1.8.4.1.804.g1f3748b\n        * new build flags\n        CC credential-store.o\n    In file included from git-compat-util.h:305:0,\n                     from cache.h:4,\n                     from credential-store.c:1:\n    compat/bswap.h:67:24: error: redefinition of 'bswap_64'\n    In file included from /usr/include/endian.h:32:0,\n                     from /usr/include/cygwin/types.h:21,\n                     from /usr/include/sys/types.h:473,\n                     from /usr/include/sys/unistd.h:9,\n                     from /usr/include/unistd.h:4,\n                     from git-compat-util.h:98,\n                     from cache.h:4,\n                     from credential-store.c:1:\n    /usr/include/byteswap.h:31:1: note: previous definition of \\\n\t‘bswap_64’ was here\n    Makefile:1985: recipe for target 'credential-store.o' failed\n    make: *** [credential-store.o] Error 1\n\nNote that cygwin has a defintion of 'bswap_64' in the <byteswap.h>\nheader file (which had already been included by git-compat-util.h).\nIn order to suppress the error, ensure that the <byteswap.h> header\nis included, just like the __GNUC__/__GLIBC__ case, rather than\nattempting to define a fallback implementation.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n compat/bswap.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/bswap.h b/compat/bswap.h\nindex ea1a9ed..b864abd 100644\n--- a/compat/bswap.h\n+++ b/compat/bswap.h\n@@ -61,7 +61,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n # define ntohll(n) (n)\n # define htonll(n) (n)\n #elif __BYTE_ORDER == __LITTLE_ENDIAN\n-#\tif defined(__GNUC__) && defined(__GLIBC__)\n+#\tif defined(__GNUC__) && (defined(__GLIBC__) || defined(__CYGWIN__))\n #\t\tinclude <byteswap.h>\n #\telse /* GNUC & GLIBC */\n static inline uint64_t bswap_64(uint64_t val)\n-- \n1.8.4\n"},{"id":"229853","messageId":"527159FE.6040706@ramsay1.demon.co.uk","threadId":"35226","inReplyTo":"5271443D.3070402@web.de","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-10-30T19:11:58Z","receivedAt":"2013-10-30T19:11:58Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 30/10/13 17:39, Torsten Bögershausen wrote:\n> On 2013-10-30 18.14, Torsten Bögershausen wrote:\n>> On 2013-10-30 18.01, Vicent Martí wrote:\n>>> On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>>>> There is a name clash under cygwin 1.7 (1.5 is OK)\n>>>> The following \"first aid hot fix\" works for me:\n>>>> /Torsten\n>>>\n>>> If Cygwin declares its own bswap_64, wouldn't it be better to use it\n>>> instead of overwriting it with our own?\n>> Yes,\n>> this will be part of a longer patch.\n>> I found that some systems have something like this:\n>>\n>> #define htobe64(x) bswap_64(x)\n>> And bswap_64 is a function, so we can not detect it by \"asking\"\n>> #ifdef bswap_64\n>> ..\n>> #endif\n>>\n>>\n>> But we can use\n>> #ifdef htobe64\n>> ...\n>> #endif\n>> and this will be part of a bigger patch.\n>>\n>> And, in general, we should avoid to introduce functions which may have a\n>> name clash.\n>> Using the git_ prefix for function names is a good practice.\n>> So in order to unbrake the compilation error under cygwin 17,\n>> the \"hotfix\" can be used.\n>> /Torsten\n> I just realized that there seem to problems to compile pu under msysgit.\n> More investigation needed here.\n\n... I noticed this too, and my patch is given below (I have another\npatch for mingw which fixes some printf format warnings too) ...\n\nHowever, you would not be surprised to hear that this breaks on msvc\ntoo, so I too was planning a larger re-write ... :-D\n\nATB,\nRamsay Jones\n\n-- >8 --\nSubject: [PATCH] compat/bswap.h: Fix failure to determine endianness on MinGW\n\nSince commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\nadded the 'ntohll' and 'htonll' helpers, the MinGW build has failed\nlike so:\n\n    GIT_VERSION = 1.8.4.1.804.g1f3748b\n        * new build flags\n        CC credential-store.o\n    In file included from git-compat-util.h:305,\n                     from cache.h:4,\n                     from credential-store.c:1:\n    compat/bswap.h:56:4: error: #error \"Cannot determine endianness\"\n    make: *** [credential-store.o] Error 1\n\nThe #error is triggered because the 'endian macros' BYTE_ORDER,\nLITTLE_ENDIAN and BIG_ENDIAN not being defined. On MinGW, these macros\nare defined in the <sys/param.h> header file. In order to suppress the\nerror, set the build variable NEEDS_SYS_PARAM_H, which will cause the\n\"git-compat-util.h\" header file to include <sys/param.h>.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n config.mak.uname | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 82d549e..c03ea1e 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -469,6 +469,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tpathsep = ;\n \tNO_PREAD = YesPlease\n \tNEEDS_CRYPTO_WITH_SSL = YesPlease\n+\tNEEDS_SYS_PARAM_H = YesPlease\n \tNO_LIBGEN_H = YesPlease\n \tNO_POLL = YesPlease\n \tNO_SYMLINK_HEAD = YesPlease\n-- \n1.8.4\n"},{"id":"229863","messageId":"52716C58.3090507@web.de","threadId":"35226","inReplyTo":"527158AF.3070204@ramsay1.demon.co.uk","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-10-30T20:30:16Z","receivedAt":"2013-10-30T20:30:16Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-10-30 20.06, Ramsay Jones wrote:\n> On 30/10/13 17:14, Torsten Bögershausen wrote:\n>> On 2013-10-30 18.01, Vicent Martí wrote:\n>>> On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>>>> There is a name clash under cygwin 1.7 (1.5 is OK)\n>>>> The following \"first aid hot fix\" works for me:\n>>>> /Torsten\n>>>\n>>> If Cygwin declares its own bswap_64, wouldn't it be better to use it\n>>> instead of overwriting it with our own?\n>> Yes,\n>> this will be part of a longer patch.\n>> I found that some systems have something like this:\n>>\n>> #define htobe64(x) bswap_64(x)\n>> And bswap_64 is a function, so we can not detect it by \"asking\"\n>> #ifdef bswap_64\n>> ..\n>> #endif\n>>\n>>\n>> But we can use\n>> #ifdef htobe64\n>> ...\n>> #endif\n>> and this will be part of a bigger patch.\n>>\n>> And, in general, we should avoid to introduce functions which may have a\n>> name clash.\n>> Using the git_ prefix for function names is a good practice.\n>> So in order to unbrake the compilation error under cygwin 17,\n>> the \"hotfix\" can be used.\n> \n> heh, my patch (given below) took a different approach, but ....\n> \n> ATB,\n> Ramsay Jones\n> \n> -- >8 --\n> Subject: [PATCH] compat/bswap.h: Fix redefinition of bswap_64 error on cygwin\n> MIME-Version: 1.0\n> Content-Type: text/plain; charset=UTF-8\n> Content-Transfer-Encoding: 8bit\n> \n> Since commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\n> the cygwin build has failed like so:\n> \n>     GIT_VERSION = 1.8.4.1.804.g1f3748b\n>         * new build flags\n>         CC credential-store.o\n>     In file included from git-compat-util.h:305:0,\n>                      from cache.h:4,\n>                      from credential-store.c:1:\n>     compat/bswap.h:67:24: error: redefinition of 'bswap_64'\n>     In file included from /usr/include/endian.h:32:0,\n>                      from /usr/include/cygwin/types.h:21,\n>                      from /usr/include/sys/types.h:473,\n>                      from /usr/include/sys/unistd.h:9,\n>                      from /usr/include/unistd.h:4,\n>                      from git-compat-util.h:98,\n>                      from cache.h:4,\n>                      from credential-store.c:1:\n>     /usr/include/byteswap.h:31:1: note: previous definition of \\\n> \t‘bswap_64’ was here\n>     Makefile:1985: recipe for target 'credential-store.o' failed\n>     make: *** [credential-store.o] Error 1\n> \n> Note that cygwin has a defintion of 'bswap_64' in the <byteswap.h>\n> header file (which had already been included by git-compat-util.h).\n> In order to suppress the error, ensure that the <byteswap.h> header\n> is included, just like the __GNUC__/__GLIBC__ case, rather than\n> attempting to define a fallback implementation.\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n>  compat/bswap.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/compat/bswap.h b/compat/bswap.h\n> index ea1a9ed..b864abd 100644\n> --- a/compat/bswap.h\n> +++ b/compat/bswap.h\n> @@ -61,7 +61,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n>  # define ntohll(n) (n)\n>  # define htonll(n) (n)\n>  #elif __BYTE_ORDER == __LITTLE_ENDIAN\n> -#\tif defined(__GNUC__) && defined(__GLIBC__)\n> +#\tif defined(__GNUC__) && (defined(__GLIBC__) || defined(__CYGWIN__))\n>  #\t\tinclude <byteswap.h>\n>  #\telse /* GNUC & GLIBC */\n>  static inline uint64_t bswap_64(uint64_t val)\n> \n\nNice, much better.\n\nAnd here comes a patch for a big endian machine.\nI tryied to copy-paste a patch in my mail program,\nnot sure if this applies.\n\n-- >8 --\nSubject: [PATCH] compat/bswap.h: htonll and ntohll for big endian\n\nSince commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\nthe build on a Linux/ppc gave a warning like this:\n    CC ewah/ewah_io.o\newah/ewah_io.c: In function ‘ewah_serialize_to’:\newah/ewah_io.c:81: warning: implicit declaration of function ‘htonll’\newah/ewah_io.c: In function ‘ewah_read_mmap’:\newah/ewah_io.c:132: warning: implicit declaration of function ‘ntohll’\n\nFix it by placing the #endif for \"#ifdef bswap32\" at the right place.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n compat/bswap.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/bswap.h b/compat/bswap.h\nindex ea1a9ed..b4ddab0\n--- a/compat/bswap.h\n+++ b/compat/bswap.h\n@@ -46,6 +46,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n #undef htonl\n #define ntohl(x) bswap32(x)\n #define htonl(x) bswap32(x)\n+#endif\n \n #ifndef __BYTE_ORDER\n #      if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n@@ -82,4 +83,3 @@ static inline uint64_t bswap_64(uint64_t val)\n #      error \"Can't define htonll or ntohll!\"\n #endif\n \n-#endif\n"},{"id":"229865","messageId":"5271750D.5010801@ramsay1.demon.co.uk","threadId":"35226","inReplyTo":"52716C58.3090507@web.de","subject":"Re: What's cooking in git.git (Oct 2013, #07; Mon, 28)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-10-30T21:07:25Z","receivedAt":"2013-10-30T21:07:25Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 30/10/13 20:30, Torsten Bögershausen wrote:\n> On 2013-10-30 20.06, Ramsay Jones wrote:\n>> On 30/10/13 17:14, Torsten Bögershausen wrote:\n>>> On 2013-10-30 18.01, Vicent Martí wrote:\n>>>> On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>>>>> There is a name clash under cygwin 1.7 (1.5 is OK)\n>>>>> The following \"first aid hot fix\" works for me:\n>>>>> /Torsten\n>>>>\n>>>> If Cygwin declares its own bswap_64, wouldn't it be better to use it\n>>>> instead of overwriting it with our own?\n>>> Yes,\n>>> this will be part of a longer patch.\n>>> I found that some systems have something like this:\n>>>\n>>> #define htobe64(x) bswap_64(x)\n>>> And bswap_64 is a function, so we can not detect it by \"asking\"\n>>> #ifdef bswap_64\n>>> ..\n>>> #endif\n>>>\n>>>\n>>> But we can use\n>>> #ifdef htobe64\n>>> ...\n>>> #endif\n>>> and this will be part of a bigger patch.\n>>>\n>>> And, in general, we should avoid to introduce functions which may have a\n>>> name clash.\n>>> Using the git_ prefix for function names is a good practice.\n>>> So in order to unbrake the compilation error under cygwin 17,\n>>> the \"hotfix\" can be used.\n>>\n>> heh, my patch (given below) took a different approach, but ....\n>>\n>> ATB,\n>> Ramsay Jones\n>>\n>> -- >8 --\n>> Subject: [PATCH] compat/bswap.h: Fix redefinition of bswap_64 error on cygwin\n>> MIME-Version: 1.0\n>> Content-Type: text/plain; charset=UTF-8\n>> Content-Transfer-Encoding: 8bit\n>>\n>> Since commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\n>> the cygwin build has failed like so:\n>>\n>>     GIT_VERSION = 1.8.4.1.804.g1f3748b\n>>         * new build flags\n>>         CC credential-store.o\n>>     In file included from git-compat-util.h:305:0,\n>>                      from cache.h:4,\n>>                      from credential-store.c:1:\n>>     compat/bswap.h:67:24: error: redefinition of 'bswap_64'\n>>     In file included from /usr/include/endian.h:32:0,\n>>                      from /usr/include/cygwin/types.h:21,\n>>                      from /usr/include/sys/types.h:473,\n>>                      from /usr/include/sys/unistd.h:9,\n>>                      from /usr/include/unistd.h:4,\n>>                      from git-compat-util.h:98,\n>>                      from cache.h:4,\n>>                      from credential-store.c:1:\n>>     /usr/include/byteswap.h:31:1: note: previous definition of \\\n>> \t‘bswap_64’ was here\n>>     Makefile:1985: recipe for target 'credential-store.o' failed\n>>     make: *** [credential-store.o] Error 1\n>>\n>> Note that cygwin has a defintion of 'bswap_64' in the <byteswap.h>\n>> header file (which had already been included by git-compat-util.h).\n>> In order to suppress the error, ensure that the <byteswap.h> header\n>> is included, just like the __GNUC__/__GLIBC__ case, rather than\n>> attempting to define a fallback implementation.\n>>\n>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>> ---\n>>  compat/bswap.h | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/compat/bswap.h b/compat/bswap.h\n>> index ea1a9ed..b864abd 100644\n>> --- a/compat/bswap.h\n>> +++ b/compat/bswap.h\n>> @@ -61,7 +61,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n>>  # define ntohll(n) (n)\n>>  # define htonll(n) (n)\n>>  #elif __BYTE_ORDER == __LITTLE_ENDIAN\n>> -#\tif defined(__GNUC__) && defined(__GLIBC__)\n>> +#\tif defined(__GNUC__) && (defined(__GLIBC__) || defined(__CYGWIN__))\n>>  #\t\tinclude <byteswap.h>\n>>  #\telse /* GNUC & GLIBC */\n>>  static inline uint64_t bswap_64(uint64_t val)\n>>\n> \n> Nice, much better.\n> \n> And here comes a patch for a big endian machine.\n> I tryied to copy-paste a patch in my mail program,\n> not sure if this applies.\n> \n> -- >8 --\n> Subject: [PATCH] compat/bswap.h: htonll and ntohll for big endian\n> \n> Since commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\n> the build on a Linux/ppc gave a warning like this:\n>     CC ewah/ewah_io.o\n> ewah/ewah_io.c: In function ‘ewah_serialize_to’:\n> ewah/ewah_io.c:81: warning: implicit declaration of function ‘htonll’\n> ewah/ewah_io.c: In function ‘ewah_read_mmap’:\n> ewah/ewah_io.c:132: warning: implicit declaration of function ‘ntohll’\n> \n> Fix it by placing the #endif for \"#ifdef bswap32\" at the right place.\n> \n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n>  compat/bswap.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/compat/bswap.h b/compat/bswap.h\n> index ea1a9ed..b4ddab0\n> --- a/compat/bswap.h\n> +++ b/compat/bswap.h\n> @@ -46,6 +46,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n>  #undef htonl\n>  #define ntohl(x) bswap32(x)\n>  #define htonl(x) bswap32(x)\n> +#endif\n>  \n>  #ifndef __BYTE_ORDER\n>  #      if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n> @@ -82,4 +83,3 @@ static inline uint64_t bswap_64(uint64_t val)\n>  #      error \"Can't define htonll or ntohll!\"\n>  #endif\n>  \n> -#endif\n> \n> .\n> \n\nYep, this was the first thing I did as well! ;-) (*late* last night)\n\nI haven't had time today to look into fixing up the msvc build\n(or a complete re-write), so I look forward to seeing your solution.\n(do you have msvc available? - or do you want me to look at fixing\nit? maybe in a day or two?)\n\nATB,\nRamsay Jones\n"},{"id":"229917","messageId":"52725A05.1050805@web.de","threadId":"35226","inReplyTo":"5271750D.5010801@ramsay1.demon.co.uk","subject":"Re: htonll, ntohll","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-10-31T13:24:21Z","receivedAt":"2013-10-31T13:24:21Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-10-30 22.07, Ramsay Jones wrote:\n> On 30/10/13 20:30, Torsten Bögershausen wrote:\n>> On 2013-10-30 20.06, Ramsay Jones wrote:\n>>> On 30/10/13 17:14, Torsten Bögershausen wrote:\n>>>> On 2013-10-30 18.01, Vicent Martí wrote:\n>>>>> On Wed, Oct 30, 2013 at 5:51 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>>>>>> There is a name clash under cygwin 1.7 (1.5 is OK)\n>>>>>> The following \"first aid hot fix\" works for me:\n>>>>>> /Torsten\n>>>>>\n>>>>> If Cygwin declares its own bswap_64, wouldn't it be better to use it\n>>>>> instead of overwriting it with our own?\n>>>> Yes,\n>>>> this will be part of a longer patch.\n>>>> I found that some systems have something like this:\n>>>>\n>>>> #define htobe64(x) bswap_64(x)\n>>>> And bswap_64 is a function, so we can not detect it by \"asking\"\n>>>> #ifdef bswap_64\n>>>> ..\n>>>> #endif\n>>>>\n>>>>\n>>>> But we can use\n>>>> #ifdef htobe64\n>>>> ...\n>>>> #endif\n>>>> and this will be part of a bigger patch.\n>>>>\n>>>> And, in general, we should avoid to introduce functions which may have a\n>>>> name clash.\n>>>> Using the git_ prefix for function names is a good practice.\n>>>> So in order to unbrake the compilation error under cygwin 17,\n>>>> the \"hotfix\" can be used.\n>>>\n>>> heh, my patch (given below) took a different approach, but ....\n>>>\n>>> ATB,\n>>> Ramsay Jones\n>>>\n>>> -- >8 --\n>>> Subject: [PATCH] compat/bswap.h: Fix redefinition of bswap_64 error on cygwin\n>>> MIME-Version: 1.0\n>>> Content-Type: text/plain; charset=UTF-8\n>>> Content-Transfer-Encoding: 8bit\n>>>\n>>> Since commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\n>>> the cygwin build has failed like so:\n>>>\n>>>     GIT_VERSION = 1.8.4.1.804.g1f3748b\n>>>         * new build flags\n>>>         CC credential-store.o\n>>>     In file included from git-compat-util.h:305:0,\n>>>                      from cache.h:4,\n>>>                      from credential-store.c:1:\n>>>     compat/bswap.h:67:24: error: redefinition of 'bswap_64'\n>>>     In file included from /usr/include/endian.h:32:0,\n>>>                      from /usr/include/cygwin/types.h:21,\n>>>                      from /usr/include/sys/types.h:473,\n>>>                      from /usr/include/sys/unistd.h:9,\n>>>                      from /usr/include/unistd.h:4,\n>>>                      from git-compat-util.h:98,\n>>>                      from cache.h:4,\n>>>                      from credential-store.c:1:\n>>>     /usr/include/byteswap.h:31:1: note: previous definition of \\\n>>> \t‘bswap_64’ was here\n>>>     Makefile:1985: recipe for target 'credential-store.o' failed\n>>>     make: *** [credential-store.o] Error 1\n>>>\n>>> Note that cygwin has a defintion of 'bswap_64' in the <byteswap.h>\n>>> header file (which had already been included by git-compat-util.h).\n>>> In order to suppress the error, ensure that the <byteswap.h> header\n>>> is included, just like the __GNUC__/__GLIBC__ case, rather than\n>>> attempting to define a fallback implementation.\n>>>\n>>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>>> ---\n>>>  compat/bswap.h | 2 +-\n>>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>>\n>>> diff --git a/compat/bswap.h b/compat/bswap.h\n>>> index ea1a9ed..b864abd 100644\n>>> --- a/compat/bswap.h\n>>> +++ b/compat/bswap.h\n>>> @@ -61,7 +61,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n>>>  # define ntohll(n) (n)\n>>>  # define htonll(n) (n)\n>>>  #elif __BYTE_ORDER == __LITTLE_ENDIAN\n>>> -#\tif defined(__GNUC__) && defined(__GLIBC__)\n>>> +#\tif defined(__GNUC__) && (defined(__GLIBC__) || defined(__CYGWIN__))\n>>>  #\t\tinclude <byteswap.h>\n>>>  #\telse /* GNUC & GLIBC */\n>>>  static inline uint64_t bswap_64(uint64_t val)\n>>>\n>>\n>> Nice, much better.\n>>\n>> And here comes a patch for a big endian machine.\n>> I tryied to copy-paste a patch in my mail program,\n>> not sure if this applies.\n>>\n>> -- >8 --\n>> Subject: [PATCH] compat/bswap.h: htonll and ntohll for big endian\n>>\n>> Since commit 452e0f20 (\"compat: add endianness helpers\", 24-10-2013)\n>> the build on a Linux/ppc gave a warning like this:\n>>     CC ewah/ewah_io.o\n>> ewah/ewah_io.c: In function ‘ewah_serialize_to’:\n>> ewah/ewah_io.c:81: warning: implicit declaration of function ‘htonll’\n>> ewah/ewah_io.c: In function ‘ewah_read_mmap’:\n>> ewah/ewah_io.c:132: warning: implicit declaration of function ‘ntohll’\n>>\n>> Fix it by placing the #endif for \"#ifdef bswap32\" at the right place.\n>>\n>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>> ---\n>>  compat/bswap.h | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/compat/bswap.h b/compat/bswap.h\n>> index ea1a9ed..b4ddab0\n>> --- a/compat/bswap.h\n>> +++ b/compat/bswap.h\n>> @@ -46,6 +46,7 @@ static inline uint32_t git_bswap32(uint32_t x)\n>>  #undef htonl\n>>  #define ntohl(x) bswap32(x)\n>>  #define htonl(x) bswap32(x)\n>> +#endif\n>>  \n>>  #ifndef __BYTE_ORDER\n>>  #      if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n>> @@ -82,4 +83,3 @@ static inline uint64_t bswap_64(uint64_t val)\n>>  #      error \"Can't define htonll or ntohll!\"\n>>  #endif\n>>  \n>> -#endif\n>>\n>> .\n>>\n> \n> Yep, this was the first thing I did as well! ;-) (*late* last night)\n> \n> I haven't had time today to look into fixing up the msvc build\n> (or a complete re-write), so I look forward to seeing your solution.\n> (do you have msvc available? - or do you want me to look at fixing\n> it? maybe in a day or two?)\n> \n> ATB,\n> Ramsay Jones\nRamsay,\nI don't have msvc, so feel free to go ahead, as much as you can.\n\nI'll send a patch for the test code I have made, and put bswap.h on hold for a week\n(to be able to continue with t5601/connect.c)\n\n/Torsten\n"},{"id":"230102","messageId":"52783518.1030908@ramsay1.demon.co.uk","threadId":"35226","inReplyTo":"52725A05.1050805@web.de","subject":"Re: htonll, ntohll","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-11-05T00:00:24Z","receivedAt":"2013-11-05T00:00:24Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 31/10/13 13:24, Torsten Bögershausen wrote:\n> On 2013-10-30 22.07, Ramsay Jones wrote:\n[ ... ]\n>> Yep, this was the first thing I did as well! ;-) (*late* last night)\n>>\n>> I haven't had time today to look into fixing up the msvc build\n>> (or a complete re-write), so I look forward to seeing your solution.\n>> (do you have msvc available? - or do you want me to look at fixing\n>> it? maybe in a day or two?)\n>>\n> Ramsay,\n> I don't have msvc, so feel free to go ahead, as much as you can.\n> \n> I'll send a patch for the test code I have made, and put bswap.h on hold for a week\n> (to be able to continue with t5601/connect.c)\n\nUnfortunately, I haven't had much time to look into this.\n\nI do have a patch (given below) that works on Linux, cygwin,\nMinGW and msvc. However, the msvc build is still broken (as a\nresult of _other_ commits in this 'jk/pack-bitmap' branch; as\nwell as the use of a VLA in another commit).\n\nSo, I still have work to do! :(\n\nAnyway, I thought I would send what I have, so you can take a look.\nNote, that I don't have an big-endian machine to test this on, so\nYMMV. Indeed, the *only* testing I have done is to run the test added\nby this branch (t5310-pack-bitmaps.sh), which works on Linux, cygwin\nand MinGW.\n\n[Note: I have never particularly liked htons, htonl et.al., so adding\nthese htonll/ntohll functions doesn't thrill me! :-D For example see\nthis post[1], which echo's my sentiments exactly.]\n\nHTH\n\nATB,\nRamsay Jones\n\n[1] http://commandcenter.blogspot.co.uk/2012/04/byte-order-fallacy.html\n\n-- >8 --\nSubject: [PATCH] compat/bswap.h: Fix build on cygwin, MinGW and msvc\n\n---\n compat/bswap.h | 97 ++++++++++++++++++++++++++++++++++++++++------------------\n 1 file changed, 68 insertions(+), 29 deletions(-)\n\ndiff --git a/compat/bswap.h b/compat/bswap.h\nindex ea1a9ed..c18a78e 100644\n--- a/compat/bswap.h\n+++ b/compat/bswap.h\n@@ -17,7 +17,20 @@ static inline uint32_t default_swab32(uint32_t val)\n \t\t((val & 0x000000ff) << 24));\n }\n \n+static inline uint64_t default_bswap64(uint64_t val)\n+{\n+\treturn (((val & (uint64_t)0x00000000000000ffULL) << 56) |\n+\t\t((val & (uint64_t)0x000000000000ff00ULL) << 40) |\n+\t\t((val & (uint64_t)0x0000000000ff0000ULL) << 24) |\n+\t\t((val & (uint64_t)0x00000000ff000000ULL) <<  8) |\n+\t\t((val & (uint64_t)0x000000ff00000000ULL) >>  8) |\n+\t\t((val & (uint64_t)0x0000ff0000000000ULL) >> 24) |\n+\t\t((val & (uint64_t)0x00ff000000000000ULL) >> 40) |\n+\t\t((val & (uint64_t)0xff00000000000000ULL) >> 56));\n+}\n+\n #undef bswap32\n+#undef bswap64\n \n #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))\n \n@@ -32,54 +45,80 @@ static inline uint32_t git_bswap32(uint32_t x)\n \treturn result;\n }\n \n+#define bswap64 git_bswap64\n+#if defined(__x86_64__)\n+static inline uint64_t git_bswap64(uint64_t x)\n+{\n+\tuint64_t result;\n+\tif (__builtin_constant_p(x))\n+\t\tresult = default_bswap64(x);\n+\telse\n+\t\t__asm__(\"bswap %q0\" : \"=r\" (result) : \"0\" (x));\n+\treturn result;\n+}\n+#else\n+static inline uint64_t git_bswap64(uint64_t x)\n+{\n+\tunion { uint64_t i64; uint32_t i32[2]; } tmp, result;\n+\tif (__builtin_constant_p(x))\n+\t\tresult.i64 = default_bswap64(x);\n+\telse {\n+\t\ttmp.i64 = x;\n+\t\tresult.i32[0] = git_bswap32(tmp.i32[1]);\n+\t\tresult.i32[1] = git_bswap32(tmp.i32[0]);\n+\t}\n+\treturn result.i64;\n+}\n+#endif\n+\n #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))\n \n #include <stdlib.h>\n \n #define bswap32(x) _byteswap_ulong(x)\n+#define bswap64(x) _byteswap_uint64(x)\n \n #endif\n \n-#ifdef bswap32\n+#if defined(bswap32)\n \n #undef ntohl\n #undef htonl\n #define ntohl(x) bswap32(x)\n #define htonl(x) bswap32(x)\n \n-#ifndef __BYTE_ORDER\n-#\tif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n-#\t\tdefine __BYTE_ORDER BYTE_ORDER\n-#\t\tdefine __LITTLE_ENDIAN LITTLE_ENDIAN\n-#\t\tdefine __BIG_ENDIAN BIG_ENDIAN\n-#\telse\n-#\t\terror \"Cannot determine endianness\"\n-#\tendif\n+#endif\n+\n+#if defined(bswap64)\n+\n+#undef ntohll\n+#undef htonll\n+#define ntohll(x) bswap64(x)\n+#define htonll(x) bswap64(x)\n+\n+#else\n+\n+#undef ntohll\n+#undef htonll\n+\n+#if !defined(__BYTE_ORDER)\n+# if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n+#  define __BYTE_ORDER BYTE_ORDER\n+#  define __LITTLE_ENDIAN LITTLE_ENDIAN\n+#  define __BIG_ENDIAN BIG_ENDIAN\n+# endif\n+#endif\n+\n+#if !defined(__BYTE_ORDER)\n+# error \"Cannot determine endianness\"\n #endif\n \n #if __BYTE_ORDER == __BIG_ENDIAN\n # define ntohll(n) (n)\n # define htonll(n) (n)\n-#elif __BYTE_ORDER == __LITTLE_ENDIAN\n-#\tif defined(__GNUC__) && defined(__GLIBC__)\n-#\t\tinclude <byteswap.h>\n-#\telse /* GNUC & GLIBC */\n-static inline uint64_t bswap_64(uint64_t val)\n-{\n-\treturn ((val & (uint64_t)0x00000000000000ffULL) << 56)\n-\t\t| ((val & (uint64_t)0x000000000000ff00ULL) << 40)\n-\t\t| ((val & (uint64_t)0x0000000000ff0000ULL) << 24)\n-\t\t| ((val & (uint64_t)0x00000000ff000000ULL) <<  8)\n-\t\t| ((val & (uint64_t)0x000000ff00000000ULL) >>  8)\n-\t\t| ((val & (uint64_t)0x0000ff0000000000ULL) >> 24)\n-\t\t| ((val & (uint64_t)0x00ff000000000000ULL) >> 40)\n-\t\t| ((val & (uint64_t)0xff00000000000000ULL) >> 56);\n-}\n-#\tendif /* GNUC & GLIBC */\n-#\tdefine ntohll(n) bswap_64(n)\n-#\tdefine htonll(n) bswap_64(n)\n-#else /* __BYTE_ORDER */\n-#\terror \"Can't define htonll or ntohll!\"\n+#else\n+# define ntohll(n) default_bswap64(n)\n+# define htonll(n) default_bswap64(n)\n #endif\n \n #endif\n-- \n1.8.4\n"},{"id":"230143","messageId":"527A6741.4000507@web.de","threadId":"35226","inReplyTo":"52783518.1030908@ramsay1.demon.co.uk","subject":"Re: htonll, ntohll","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-11-06T15:58:57Z","receivedAt":"2013-11-06T15:58:57Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-11-05 01.00, Ramsay Jones wrote:\n> On 31/10/13 13:24, Torsten Bögershausen wrote:\n>> On 2013-10-30 22.07, Ramsay Jones wrote:\n> [ ... ]\n>>> Yep, this was the first thing I did as well! ;-) (*late* last night)\n>>>\n>>> I haven't had time today to look into fixing up the msvc build\n>>> (or a complete re-write), so I look forward to seeing your solution.\n>>> (do you have msvc available? - or do you want me to look at fixing\n>>> it? maybe in a day or two?)\n>>>\n>> Ramsay,\n>> I don't have msvc, so feel free to go ahead, as much as you can.\n>>\n>> I'll send a patch for the test code I have made, and put bswap.h on hold for a week\n>> (to be able to continue with t5601/connect.c)\n> \n> Unfortunately, I haven't had much time to look into this.\n> \n> I do have a patch (given below) that works on Linux, cygwin,\n> MinGW and msvc. However, the msvc build is still broken (as a\n> result of _other_ commits in this 'jk/pack-bitmap' branch; as\n> well as the use of a VLA in another commit).\n> \n> So, I still have work to do! :(\n> \n> Anyway, I thought I would send what I have, so you can take a look.\n> Note, that I don't have an big-endian machine to test this on, so\n> YMMV. Indeed, the *only* testing I have done is to run the test added\n> by this branch (t5310-pack-bitmaps.sh), which works on Linux, cygwin\n> and MinGW.\n> \n> [Note: I have never particularly liked htons, htonl et.al., so adding\n> these htonll/ntohll functions doesn't thrill me! :-D For example see\n> this post[1], which echo's my sentiments exactly.]\n> \n> HTH\n> \n> ATB,\n> Ramsay Jones\n> \n> [1] http://commandcenter.blogspot.co.uk/2012/04/byte-order-fallacy.html\n> \n> -- >8 --\n> Subject: [PATCH] compat/bswap.h: Fix build on cygwin, MinGW and msvc\n> \n> ---\n>  compat/bswap.h | 97 ++++++++++++++++++++++++++++++++++++++++------------------\n>  1 file changed, 68 insertions(+), 29 deletions(-)\n> \n> diff --git a/compat/bswap.h b/compat/bswap.h\n> index ea1a9ed..c18a78e 100644\n> --- a/compat/bswap.h\n> +++ b/compat/bswap.h\n> @@ -17,7 +17,20 @@ static inline uint32_t default_swab32(uint32_t val)\n>  \t\t((val & 0x000000ff) << 24));\n>  }\n>  \n> +static inline uint64_t default_bswap64(uint64_t val)\n> +{\n> +\treturn (((val & (uint64_t)0x00000000000000ffULL) << 56) |\n> +\t\t((val & (uint64_t)0x000000000000ff00ULL) << 40) |\n> +\t\t((val & (uint64_t)0x0000000000ff0000ULL) << 24) |\n> +\t\t((val & (uint64_t)0x00000000ff000000ULL) <<  8) |\n> +\t\t((val & (uint64_t)0x000000ff00000000ULL) >>  8) |\n> +\t\t((val & (uint64_t)0x0000ff0000000000ULL) >> 24) |\n> +\t\t((val & (uint64_t)0x00ff000000000000ULL) >> 40) |\n> +\t\t((val & (uint64_t)0xff00000000000000ULL) >> 56));\n> +}\n> +\n>  #undef bswap32\n> +#undef bswap64\n>  \n>  #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))\n>  \n> @@ -32,54 +45,80 @@ static inline uint32_t git_bswap32(uint32_t x)\n>  \treturn result;\n>  }\n>  \n> +#define bswap64 git_bswap64\n> +#if defined(__x86_64__)\n> +static inline uint64_t git_bswap64(uint64_t x)\n> +{\n> +\tuint64_t result;\n> +\tif (__builtin_constant_p(x))\n> +\t\tresult = default_bswap64(x);\n> +\telse\n> +\t\t__asm__(\"bswap %q0\" : \"=r\" (result) : \"0\" (x));\n> +\treturn result;\n> +}\n> +#else\n> +static inline uint64_t git_bswap64(uint64_t x)\n> +{\n> +\tunion { uint64_t i64; uint32_t i32[2]; } tmp, result;\n> +\tif (__builtin_constant_p(x))\n> +\t\tresult.i64 = default_bswap64(x);\n> +\telse {\n> +\t\ttmp.i64 = x;\n> +\t\tresult.i32[0] = git_bswap32(tmp.i32[1]);\n> +\t\tresult.i32[1] = git_bswap32(tmp.i32[0]);\n> +\t}\n> +\treturn result.i64;\n> +}\n> +#endif\n> +\n>  #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))\n>  \n>  #include <stdlib.h>\n>  \n>  #define bswap32(x) _byteswap_ulong(x)\n> +#define bswap64(x) _byteswap_uint64(x)\n>  \n>  #endif\n>  \n> -#ifdef bswap32\n> +#if defined(bswap32)\n>  \n>  #undef ntohl\n>  #undef htonl\n>  #define ntohl(x) bswap32(x)\n>  #define htonl(x) bswap32(x)\n>  \n> -#ifndef __BYTE_ORDER\n> -#\tif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n> -#\t\tdefine __BYTE_ORDER BYTE_ORDER\n> -#\t\tdefine __LITTLE_ENDIAN LITTLE_ENDIAN\n> -#\t\tdefine __BIG_ENDIAN BIG_ENDIAN\n> -#\telse\n> -#\t\terror \"Cannot determine endianness\"\n> -#\tendif\n> +#endif\n> +\n> +#if defined(bswap64)\n> +\n> +#undef ntohll\n> +#undef htonll\n> +#define ntohll(x) bswap64(x)\n> +#define htonll(x) bswap64(x)\n> +\n> +#else\n> +\n> +#undef ntohll\n> +#undef htonll\n> +\n> +#if !defined(__BYTE_ORDER)\n> +# if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n> +#  define __BYTE_ORDER BYTE_ORDER\n> +#  define __LITTLE_ENDIAN LITTLE_ENDIAN\n> +#  define __BIG_ENDIAN BIG_ENDIAN\n> +# endif\n> +#endif\n> +\n> +#if !defined(__BYTE_ORDER)\n> +# error \"Cannot determine endianness\"\n>  #endif\n>  \n>  #if __BYTE_ORDER == __BIG_ENDIAN\n>  # define ntohll(n) (n)\n>  # define htonll(n) (n)\n> -#elif __BYTE_ORDER == __LITTLE_ENDIAN\n> -#\tif defined(__GNUC__) && defined(__GLIBC__)\n> -#\t\tinclude <byteswap.h>\n> -#\telse /* GNUC & GLIBC */\n> -static inline uint64_t bswap_64(uint64_t val)\n> -{\n> -\treturn ((val & (uint64_t)0x00000000000000ffULL) << 56)\n> -\t\t| ((val & (uint64_t)0x000000000000ff00ULL) << 40)\n> -\t\t| ((val & (uint64_t)0x0000000000ff0000ULL) << 24)\n> -\t\t| ((val & (uint64_t)0x00000000ff000000ULL) <<  8)\n> -\t\t| ((val & (uint64_t)0x000000ff00000000ULL) >>  8)\n> -\t\t| ((val & (uint64_t)0x0000ff0000000000ULL) >> 24)\n> -\t\t| ((val & (uint64_t)0x00ff000000000000ULL) >> 40)\n> -\t\t| ((val & (uint64_t)0xff00000000000000ULL) >> 56);\n> -}\n> -#\tendif /* GNUC & GLIBC */\n> -#\tdefine ntohll(n) bswap_64(n)\n> -#\tdefine htonll(n) bswap_64(n)\n> -#else /* __BYTE_ORDER */\n> -#\terror \"Can't define htonll or ntohll!\"\n> +#else\n> +# define ntohll(n) default_bswap64(n)\n> +# define htonll(n) default_bswap64(n)\n>  #endif\n>  \n>  #endif\n> \nI have had time to test it, works on Linux/PPC (big endian)\nand Mac OS.\n\nWhat do we think about going ahead with this patch?\n/Torsten\n"},{"id":"230491","messageId":"52823ED1.1020306@gmail.com","threadId":"35226","inReplyTo":"52783518.1030908@ramsay1.demon.co.uk","subject":"Re: htonll, ntohll","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2013-11-12T14:44:33Z","receivedAt":"2013-11-12T14:44:33Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 2013-11-05 01:00, Ramsay Jones pisze:\n\n> [Note: I have never particularly liked htons, htonl et.al., so adding\n> these htonll/ntohll functions doesn't thrill me! :-D For example see\n> this post[1], which echo's my sentiments exactly.]\n>\n> HTH\n>\n> ATB,\n> Ramsay Jones\n>\n> [1] http://commandcenter.blogspot.co.uk/2012/04/byte-order-fallacy.html\n\nErrr... htonl is about host to network order, and not about big- or\nlittle-endianness of architecture.  The macros are good, its their\nimplementation that might fail [1].\n\n-- \nJakub Narębski\n"},{"id":"230563","messageId":"52836E84.3020901@op5.se","threadId":"35226","inReplyTo":"52783518.1030908@ramsay1.demon.co.uk","subject":"Re: htonll, ntohll","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2013-11-13T12:20:20Z","receivedAt":"2013-11-13T12:20:20Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"On 2013-11-05 01:00, Ramsay Jones wrote:\n>\n> [Note: I have never particularly liked htons, htonl et.al., so adding\n> these htonll/ntohll functions doesn't thrill me! :-D For example see\n> this post[1], which echo's my sentiments exactly.]\n>\n\nThat post actually contradicts your statement, as it clearly states\nthat \"someone at Adobe figured out about byte order and there would\nhave been no problems transferring files between (big-endian and\nlittle-endian) machines... if the people at Adobe wrote proper code\nto encode and decode their files\".\n\nhtonl(), ntohl(), htons(), ntohs() are those \"encode\" and \"decode\"\nfunctions. If you or the author of the post you linked think otherwise,\nyou're misinformed and need to learn what encoding and decoding means.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"}]}