{"push_id":1195037616,"size":39,"distinct_size":21,"ref":"refs/heads/pu","head":"c5b58dccdb1702a5e7520eb81968c12c3a6e1769","before":"a99364426af835e2db486a4561e09be355215791","commits":[{"sha":"aabbd3f3c9dd17c414100d0e029f8a3d13673ab1","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"config: fix bogus fd check when setting up default config\n\nSince 9830534 (config --global --edit: create a template\nfile if needed, 2014-07-25), an edit of the global config\nfile will try to open() it with O_EXCL, and wants to handle\nthree cases:\n\n  1. We succeeded; the user has no config file, and we\n     should fill in the default template.\n\n  2. We got EEXIST; they have a file already, proceed as usual.\n\n  3. We got another error; we should complain.\n\nHowever, the check for case 1 does \"if (fd)\", which will\ngenerally _always_ be true (except for the oddball case that\nsomehow our stdin got closed and opening really did give us\na new descriptor 0).\n\nSo in the EEXIST case, we tried to write the default config\nanyway! Fortunately, this turns out to be a noop, since we\njust end up writing to and closing \"-1\", which does nothing.\n\nBut in case 3, we would fail to notice any other errors, and\njust silently continue (given that we don't actually notice\nwrite errors for the template either, it's probably not that\nbig a deal; we're about to spawn the editor, so it would\nnotice any problems. But the code is clearly _trying_ to hit\ncover this case and failing).\n\nWe can fix it easily by using \"fd >= 0\" for case 1.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/aabbd3f3c9dd17c414100d0e029f8a3d13673ab1"},{"sha":"1dad879a7b7b41381cf4ccf471dcab06993a131b","author":{"name":"René Scharfe","email":"01bf718383f1a71128a0f88aabe513a64e609746@web.de"},"message":"am: ignore return value of write_file()\n\nwrite_file() either returns 0 or dies, so there is no point in checking\nits return value.  The callers of the wrappers write_state_text(),\nwrite_state_count() and write_state_bool() consequently already ignore\ntheir return values.  Stop pretending we care and make them void.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/1dad879a7b7b41381cf4ccf471dcab06993a131b"},{"sha":"3d75bba28d8665ec43f1faffce38d5817c77ebe8","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"branch: use non-gentle write_file for branch description\n\nWe use write_file_gently() to do this job currently.\nHowever, if we see an error, we simply complain via\nerror_errno() and then end up exiting with an error code.\n\nBy switching to the non-gentle form, the function will die\nfor us, with a better error. It is more specific about which\nsyscall caused the error, and that mentions the\nactual filename we're trying to write.\n\nOur exit code for the error case does switch from \"1\" to\n\"128\", but that's OK; it wasn't a meaningful documented code\n(and in fact it was odd that it was a different exit code\nthan most other error conditions).\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/3d75bba28d8665ec43f1faffce38d5817c77ebe8"},{"sha":"ef22318cff51244cd0047b11ee7accfded522782","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"write_file: drop \"gently\" form\n\nThere are no callers left of write_file_gently(). Let's drop\nit, as it doesn't seem likely for new callers to be added\n(since its inception, the only callers who wanted the gentle\nform generally just died immediately themselves, and have\nsince been converted).\n\nWhile we're there, let's also drop the \"int\" return from\nwrite_file, as it is never meaningful (in the non-gentle\nform, we always either die or return 0).\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/ef22318cff51244cd0047b11ee7accfded522782"},{"sha":"ee861e0f78367ff0e94feeb42f721ef83ceec251","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"write_file: use xopen\n\nThis simplifies the code a tiny bit, and provides consistent\nerror messages with other users of xopen().\n\nWhile we're here, let's also switch to using O_WRONLY. We\nknow we're only going to open/write/close the file, so\nthere's no point in asking for O_RDWR.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/ee861e0f78367ff0e94feeb42f721ef83ceec251"},{"sha":"52563d7ecc8f3f38cb1c0521294c5f6a0a475637","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"write_file: add pointer+len variant\n\nThere are many callsites which could use write_file, but for\nwhich it is a little awkward because they have a strbuf or\nother pointer/len combo. Specifically:\n\n 1. write_file() takes a format string, so we have to use\n    \"%s\" or \"%.*s\", which are ugly.\n\n 2. Using any form of \"%s\" does not handle embedded NULs in\n    the output. That probably doesn't matter for our\n    call-sites, but it's nicer not to have to worry.\n\n 3. It's less efficient; we format into another strbuf\n    just to do the write. That's probably not measurably\n    slow for our uses, but it's simply inelegant.\n\nWe can fix this by providing a helper to write out the\nformatted buffer, and just calling it from write_file().\n\nNote that we don't do the usual \"complete with a newline\"\nthat write_file does. If the caller has their own buffer,\nthere's a reasonable chance they're doing something more\ncomplicated than a single line, and they can call\nstrbuf_complete_line() themselves.\n\nWe could go even further and add strbuf_write_file(), but it\ndoesn't save much:\n\n  -  write_file_buf(path, sb.buf, sb.len);\n  +  strbuf_write_file(&sb, path);\n\nIt would also be somewhat asymmetric with strbuf_read_file,\nwhich actually returns errors rather than dying (and the\nerror handling is most of the benefit of write_file() in the\nfirst place).\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/52563d7ecc8f3f38cb1c0521294c5f6a0a475637"},{"sha":"e04d08a4b3373972717c805ae8e788219b873b2a","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"write_file: add format attribute\n\nThis gives us compile-time checking of our format strings,\nwhich is a good thing.\n\nI had also hoped it would help with confusing write_file()\nand write_file_buf(), since the former's \"...\" can make it\nmatch the signature of the latter. But given that the buffer\nfor write_file_buf() is generally not a string literal, the\ncompiler won't complain unless -Wformat-nonliteral is on,\nand that creates a ton of false positives elsewhere in the\ncode base.\n\nWhile we're there, let's also give the function a docstring,\nwhich it never had.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/e04d08a4b3373972717c805ae8e788219b873b2a"},{"sha":"e78d5d49935373dabcc40c5e32aefe4956a70b97","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"use write_file_buf where applicable\n\nThere are several places where we open a file, write some\ncontent from a strbuf, and close it. These can be simplified\nwith write_file_buf(). As a bonus, many of these did not\ncatch write problems at close() time.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/e78d5d49935373dabcc40c5e32aefe4956a70b97"},{"sha":"7eb6e10c9d7f43913615667740d1b22055cfba1f","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"branch: use write_file_buf instead of write_file\n\nIf we already have a strbuf, then using write_file_buf is a\nlittle nicer to read (no wondering whether \"%s\" will eat\nyour NULs), and it's more efficient (no extra formatting\nstep).\n\nWe don't care about the newline magic of write_file(), as we\nhave our own multi-line content.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/7eb6e10c9d7f43913615667740d1b22055cfba1f"},{"sha":"fa262cac766d383c51e0ead04c62e114a79bd738","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"walker: let walker_say take arbitrary formats\n\nWe take a printf-style format and a single \"char *\"\nparameter, and the format must therefore have at most one\n\"%s\" in it. Besides being error-prone (and tickling\n-Wformat-nonliteral), this is unnecessarily restrictive. We\ncan just provide the usual varargs interface.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/fa262cac766d383c51e0ead04c62e114a79bd738"},{"sha":"dabd35f4cdd8bcfa502d082da5a3e4b927a2b329","author":{"name":"Jeff King","email":"7e57302763bea699aee296fb53304dc616ab92d5@peff.net"},"message":"avoid using sha1_to_hex output as printf format\n\nWe know that it should not contain any percent-signs, but\nit's a good habit not to feed non-literals to printf\nformatters.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/dabd35f4cdd8bcfa502d082da5a3e4b927a2b329"},{"sha":"54307ea7c3ced760ee375483a786ec7180798aed","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"commit.c: remove print_commit_list()\n\nThe helper function tries to offer a way to conveniently show the\nlast one differently from others, presumably to allow you to say\nsomething like\n\n\tA, B, and C.\n\nwhile iterating over a list that has these three elements.\n\nHowever, there is only one caller, and it passes the same format\nstring \"%s\\n\" for both the last one and the other ones.  Retire the\nhelper function and update the caller with a simplified version.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/54307ea7c3ced760ee375483a786ec7180798aed"},{"sha":"b2330ff86468b7be1ebf2e3c4f265894d58ece30","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"merge: avoid \"safer crlf\" during recording of merge results\n\nWhen merge_recursive() decides what the correct blob object merge\nresult for a path should be, it uses update_file_flags() helper\nfunction to write it out to a working tree file and then calls\nadd_cacheinfo().  The add_cacheinfo() function in turn calls\nmake_cache_entry() to create a new cache entry to replace the\nhigher-stage entries for the path that represents the conflict.\n\nThe make_cache_entry() function calls refresh_cache_entry() to fill\nin the cached stat information.  To mark a cache entry as\nup-to-date, the data is re-read from the file in the working tree,\nand goes through convert_to_git() conversion to be compared with the\nblob object name the new cache entry records.\n\nIt is important to note that this happens while the higher-stage\nentries, which are going to be replaced with the new entry, are\nstill in the index.  Unfortunately, the convert_to_git() conversion\nhas a misguided \"safer crlf\" mechanism baked in, and looks at the\nexisting cache entry for the path to decide how to convert the\ncontents in the working tree file.  If our side (i.e. stage#2)\nrecords a text blob with CRLF in it, even when the system is\nconfigured to record LF in blobs and convert them to CRLF upon\ncheckout (and back to LF upon checkin), the \"safer crlf\" mechanism\nstops us doing so.\n\nThis especially poses a problem during a renormalizing merge, where\nthe merge result for the path is computed by first \"normalizing\" the\nblobs involved in the merge by using convert_to_working_tree()\nfollowed by convert_to_git() with \"safer crlf\" disabled.  The merge\nresult that is computed correctly and fed to add_cacheinfo() via\nupdate_file_flags() does _not_ match what refresh_cache_entry() sees\nby converting the working tree file via convert_to_git().\n\nWe can work this around by not refreshing the individual cache\nentries in make_cache_entry() called by add_cacheinfo().  After we\nare finished mergeing, we call refresh_cache() to take care of the\nrefreshing of the stat information.  By the time this refreshing\nhappens, the stale cache entries that had CRLF in stage #2 that were\ncarried over before the renormalizing merge started will all be gone\nand will not interfere with the correct recording of the result.\n\nThe test update was taken from a series by Torsten Bögershausen\nthat attempted to fix this with a different approach (which was a\nlot more intrusive).\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/b2330ff86468b7be1ebf2e3c4f265894d58ece30"},{"sha":"63127603e1f9a77d931bdcaef8f5203c9780a391","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"Merge branch 'jk/printf-format' into jch\n\n* jk/printf-format:\n  commit.c: remove print_commit_list()\n  avoid using sha1_to_hex output as printf format\n  walker: let walker_say take arbitrary formats","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/63127603e1f9a77d931bdcaef8f5203c9780a391"},{"sha":"4a590ee1c9fc3037285db1a605f949afa001c3e8","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"Merge branch 'jk/write-file' into jch\n\n* jk/write-file:\n  branch: use write_file_buf instead of write_file\n  use write_file_buf where applicable\n  write_file: add format attribute\n  write_file: add pointer+len variant\n  write_file: use xopen\n  write_file: drop \"gently\" form\n  branch: use non-gentle write_file for branch description\n  am: ignore return value of write_file()\n  config: fix bogus fd check when setting up default config","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/4a590ee1c9fc3037285db1a605f949afa001c3e8"},{"sha":"01c0f4447e8c0900437a818ea1f707013204bcc4","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"Merge branch 'rs/help-c-source-with-gitattributes' into jch\n\nThe .c/.h sources are marked as such in our .gitattributes file so\nthat \"git diff -W\" and friends would work better.\n\n* rs/help-c-source-with-gitattributes:\n  .gitattributes: set file type for C files","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/01c0f4447e8c0900437a818ea1f707013204bcc4"},{"sha":"741ae46b50c90c671b1a797ec23ae2279cc6a581","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"Merge branch 'rw/make-needs-librt' into jch\n\nMakefile assumed that -lrt is always available on platforms that\nwant to use clock_gettime() and CLOCK_MONOTONIC, which is not a\ncase for recent Mac OS X.  The necessary symbols are often found in\nlibc on many modern systems and having -lrt on the command line, as\nlong as the library exists, had no effect, but when the platform\nremoves librt.a that is a different matter--having -lrt will break\nthe linkage.\n\nThis change could be seen as a regression for those who do need to\nspecify -lrt, as they now specifically ask for NEEDS_LIBRT when\nbuilding. Hopefully they are in the minority these days.\n\n* rw/make-needs-librt:\n  Makefile: add NEEDS_LIBRT to optionally link with librt","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/741ae46b50c90c671b1a797ec23ae2279cc6a581"},{"sha":"bea6568cac082c402016f93919e34fecabdf3d4b","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"Merge branch 'rs/notes-merge-no-toctou' into jch\n\n\"git notes merge\" had a code to see if a path exists (and fails if\nit does) and then open the path for writing (when it doesn't).\nReplace it with open with O_EXCL.\n\n* rs/notes-merge-no-toctou:\n  notes-merge: use O_EXCL to avoid overwriting existing files","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/bea6568cac082c402016f93919e34fecabdf3d4b"},{"sha":"8d083a61f7f7f93b5f722b3381150cb97dd1d2c9","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"Merge branch 'jc/attr' into pu\n\nThe attributes API has been updated so that it can later be\noptimized using the knowledge of which attributes are queried.\n\nI wanted to polish this topic further to make the attribute\nsubsystem thread-ready, but because other topics depend on this\ntopic and they do not (yet) need it to be thread-ready, let's merge\nthis early part together with the dependent topics to 'next', and\nback-burner the threading enhancement to another day.\n\n* jc/attr:\n  attr: support quoting pathname patterns in C style\n  attr: expose validity check for attribute names\n  attr: add counted string version of git_attr()\n  attr: add counted string version of git_check_attr()\n  attr: retire git_check_attrs() API\n  attr: convert git_check_attrs() callers to use the new API\n  attr: convert git_all_attrs() to use \"struct git_attr_check\"\n  attr: (re)introduce git_check_attr() and struct git_attr_check\n  attr: rename function and struct related to checking attributes\n  attr.c: plug small leak in parse_attr_line()\n  attr.c: tighten constness around \"git_attr\" structure\n  attr.c: simplify macroexpand_one()\n  attr.c: mark where #if DEBUG ends more clearly\n  attr.c: complete a sentence in a comment\n  attr.c: explain the lack of attr-name syntax check in parse_attr()\n  attr.c: update a stale comment on \"struct match_attr\"\n  attr.c: use strchrnul() to scan for one line\n  commit.c: use strchrnul() to scan for one line","distinct":true,"url":"https://api.github.com/repos/gitster/git/commits/8d083a61f7f7f93b5f722b3381150cb97dd1d2c9"},{"sha":"30ac1c81e80ecaafdad01d721e28b6aa8913ef45","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"Merge branch 'sb/pathspec-label' into pu\n\nThe pathspec mechanism learned \":(attr:X)$pattern\" pathspec magic\nto limit paths that match $pattern further by attribute settings.\nThe preload-index mechanism is disabled when the new pathspec magic\nis in use (at least for now), because the attribute subsystem is\nnot thread-ready.\n\n* sb/pathspec-label:\n  pathspec: disable preload-index when attribute pathspec magic is in use\n  pathspec: allow escaped query values\n  pathspec: allow querying for attributes\n  pathspec: move prefix check out of the inner loop\n  pathspec: move long magic parsing out of prefix_pathspec\n  Documentation: fix a typo","distinct":true,"url":"https://api.github.com/repos/gitster/git/commits/30ac1c81e80ecaafdad01d721e28b6aa8913ef45"}]}
{"actor":{"display_login":"gitster"}}