{"push_id":2102593374,"size":122,"distinct_size":0,"ref":"refs/heads/jk/test-x-for-all","head":"6f3569b395d6c599aeaadac2850e2960bb7022c3","before":"dcbca0957ee1fd2e015debf0aa4b4d78b18656b8","commits":[{"sha":"229a95aafa77b583b46a3156b4fad469c264ddfd","author":{"name":"Junio C Hamano","email":"3228067b6039a0d99bddaf967dafdecd5cc61600@pobox.com"},"message":"t0027: do not use an empty string as a pathspec element\n\nIn an upcoming update, we will finally make an empty string illegal\nas an element in a pathspec; it traditionally meant the same as \".\",\ni.e. include everything, so update this test that passes \"\" to pass\na dot instead.\n\nAt this point in the test sequence, there is no modified path that\nneed to be further added before committing; the working tree is\nempty except for .gitattributes which was just added to the index.\nSo we could instead pass no pathspec, but this is a conversion more\nfaithful to the original.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/229a95aafa77b583b46a3156b4fad469c264ddfd"},{"sha":"9e4e8a64c2b9043b7ae2b6476efd9214c6738505","author":{"name":"Emily Xie","email":"a5470d27d771bc9362da73e3e211e227af3a699d@gmail.com"},"message":"pathspec: die on empty strings as pathspec\n\nAn empty string as a pathspec element matches all paths.  A buggy\nscript, however, could accidentally assign an empty string to a\nvariable that then gets passed to a Git command invocation, e.g.:\n\n  path=... compute a path to be removed in $path ...\n        git rm -r \"$path\"\n\nwhich would unintentionally remove all paths in the current\ndirectory.\n\nThe fix for this issue comprises of two steps. Step 1, which warns\nthat empty strings as pathspecs will become invalid, has already\nbeen implemented in commit d426430 (\"pathspec: warn on empty strings\nas pathspec\", 2016-06-22).\n\nThis patch is step 2. It removes the warning and throws an error\ninstead.\n\nSigned-off-by: Emily Xie <emilyxxie@gmail.com>\nReported-by: David Turner <novalis@novalis.org>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/9e4e8a64c2b9043b7ae2b6476efd9214c6738505"},{"sha":"74a10642aa88c52ebb169489ea212a592d7bf3ce","author":{"name":"Prathamesh Chavan","email":"a910fe89e54c7a6a84da414a8f5a3eda0c9cb083@gmail.com"},"message":"submodule--helper: introduce get_submodule_displaypath()\n\nIntroduce function get_submodule_displaypath() to replace the code\noccurring in submodule_init() for generating displaypath of the\nsubmodule with a call to it.\n\nThis new function will also be used in other parts of the system\nin later patches.\n\nMentored-by: Christian Couder <christian.couder@gmail.com>\nMentored-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Prathamesh Chavan <pc44800@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/74a10642aa88c52ebb169489ea212a592d7bf3ce"},{"sha":"f132a127eebb8f1b14b87fc317ca68278fceb2e8","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"sha1_file: do not leak `lock_file`\n\nThere is no longer any need to allocate and leak a `struct lock_file`.\nInitialize it on the stack instead.\n\nBefore this patch, we set `lock = NULL` to signal that we have already\nrolled back, and that we should not do any more work. We need to take\nanother approach now that we cannot assign NULL. We could, e.g., use\n`is_lock_file_locked()`. But we already have another variable that we\ncould use instead, `found`. Its scope is only too small.\n\nBump `found` to the scope of the whole function and rearrange the \"roll\nback or write?\"-checks to a straightforward if-else on `found`. This\nalso future-proves the code by making it obvious that we intend to take\nexactly one of these paths.\n\nImproved-by: Jeff King <peff@peff.net>\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/f132a127eebb8f1b14b87fc317ca68278fceb2e8"},{"sha":"837e34eba47f209a38fc9ab458bd103fd7515325","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"treewide: prefer lockfiles on the stack\n\nThere is no longer any need to allocate and leak a `struct lock_file`.\nThe previous patch addressed an instance where we needed a minor tweak\nalongside the trivial changes.\n\nDeal with the remaining instances where we allocate and leak a struct\nwithin a single function. Change them to have the `struct lock_file` on\nthe stack instead.\n\nThese instances were identified by running `git grep \"^\\s*struct\nlock_file\\s*\\*\"`.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/837e34eba47f209a38fc9ab458bd103fd7515325"},{"sha":"d613576dfe7010b13157e63b2401d321074bbab8","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"lockfile: fix documentation on `close_lock_file_gently()`\n\nCommit 83a3069a3 (lockfile: do not rollback lock on failed close,\n2017-09-05) forgot to update the documentation by the function definition\nto reflect that the lock is not rolled back in case closing fails.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/d613576dfe7010b13157e63b2401d321074bbab8"},{"sha":"5de134ca8594de22f2a0b738824f9b5176ae6c00","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"tempfile: fix documentation on `delete_tempfile()`\n\nThe function has always been documented as returning 0 or -1. It is in\nfact `void`. Correct that. As part of the rearrangements we lose the\nmention that `delete_tempfile()` might set `errno`. Because there is\nno return value, the user can't really know whether it did anyway.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/5de134ca8594de22f2a0b738824f9b5176ae6c00"},{"sha":"02ae242fdde2ba8acb6b87e32df2b1e33786e78b","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"checkout-index: simplify locking logic\n\n`newfd` starts out negative. If we then take the lock, `newfd` will\nbecome non-negative. We later check for exactly that property before\ncalling `write_locked_index()`. That is, we are simply using `newfd` as\na boolean to keep track of whether we took the lock or not. (We always\nuse `newfd` and `lock_file` together, so they really are mirroring each\nother.)\n\nDrop `newfd` and check with `is_lock_file_locked()` instead. While at\nit, move the `static struct lock_file` into `cmd_checkout_index()` and\nmake it non-static. It is only used in this function, and after\n076aa2cbd (tempfile: auto-allocate tempfiles on heap, 2017-09-05), we\ncan have lockfiles on the stack.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/02ae242fdde2ba8acb6b87e32df2b1e33786e78b"},{"sha":"2954e5ec4361c6932593663859aa437583edb500","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"cache-tree: simplify locking logic\n\nAfter we have taken the lock using `LOCK_DIE_ON_ERROR`, we know that\n`newfd` is non-negative. So when we check for exactly that property\nbefore calling `write_locked_index()`, the outcome is guaranteed.\n\nIf we write and commit successfully, we set `newfd = -1`, so that we can\nlater avoid calling `rollback_lock_file` on an already-committed lock.\nBut we might just as well unconditionally call `rollback_lock_file()` --\nit will be a no-op if we have already committed.\n\nAll in all, we use `newfd` as a bool and the only benefit we get from it\nis that we can avoid calling a no-op. Remove `newfd` so that we have one\nvariable less to reason about.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/2954e5ec4361c6932593663859aa437583edb500"},{"sha":"6d058c882643dc45c8d708be98e86c38f25511a9","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"apply: move lockfile into `apply_state`\n\nWe have two users of `struct apply_state` and the related functionality\nin apply.c. Each user sets up its `apply_state` by handing over a\npointer to its static `lock_file`. (Before 076aa2cbd (tempfile:\nauto-allocate tempfiles on heap, 2017-09-05), we could never free\nlockfiles, so making them static was a reasonable approach.)\n\nOther than that, they never directly access their `lock_file`s, which\nare instead handled by the functionality in apply.c.\n\nTo make life easier for the caller and to make it less tempting for a\nfuture caller to mess with the lock, make apply.c fully responsible for\nsetting up the `lock_file`. As mentioned above, it is now safe to free a\n`lock_file`, so we can make the `struct apply_state` contain an actual\n`struct lock_file` instead of a pointer to one.\n\nThe user in builtin/apply.c is rather simple. For builtin/am.c, we might\nworry that the lock state is actually meant to be inherited across\ncalls. But the lock is only taken as `apply_all_patches()` executes, and\ncode inspection shows that it will always be released.\n\nAlternatively, we can observe that the lock itself is never queried\ndirectly. When we decide whether we should lock, we check a related\nvariable `newfd`. That variable is not inherited, so from the point of\nview of apply.c, the state machine really is reset with each call to\n`init_apply_state()`. (It would be a bug if `newfd` and the lock status\nwere not in sync. The duplication of information in `newfd` and the lock\nwill be addressed in the next patch.)\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/6d058c882643dc45c8d708be98e86c38f25511a9"},{"sha":"d13cd4c92760d8fe01fb51fbab556a4d1f3713b4","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"apply: remove `newfd` from `struct apply_state`\n\nSimilar to a previous patch, we do not need to use `newfd` to signal\nthat we have a lockfile to clean up. We can just unconditionally call\n`rollback_lock_file`. If we do not hold the lock, it will be a no-op.\n\nWhere we check `newfd` to decide whether we need to take the lock, we\ncan instead use `is_lock_file_locked()`.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/d13cd4c92760d8fe01fb51fbab556a4d1f3713b4"},{"sha":"8dc3834610b676c2eb64cfe2a08b8b3d05be05df","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"cache.h: document `write_locked_index()`\n\nThe next patches will tweak the behavior of this function. Document it\nin order to establish a basis for those patches.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/8dc3834610b676c2eb64cfe2a08b8b3d05be05df"},{"sha":"9e1c84dfd5311c80962ea0f8a1589881c20d028d","author":{"name":"Pranit Bauva","email":"40a45a699d3945bf6e080cdb09dfa314e9c99236@gmail.com"},"message":"bisect--helper: use OPT_CMDMODE instead of OPT_BOOL\n\n`--next-all` is meant to be used as a subcommand to support multiple\n\"operation mode\" though the current implementation does not contain any\nother subcommand along side with `--next-all` but further commits will\ninclude some more subcommands.\n\nHelped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nMentored-by: Lars Schneider <larsxschneider@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Pranit Bauva <pranit.bauva@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/9e1c84dfd5311c80962ea0f8a1589881c20d028d"},{"sha":"4ba1e5c4144bd268dafb252fd652dd37d9e4a1ed","author":{"name":"Pranit Bauva","email":"40a45a699d3945bf6e080cdb09dfa314e9c99236@gmail.com"},"message":"bisect--helper: rewrite `check_term_format` shell function in C\n\nReimplement the `check_term_format` shell function in C and add\na `--check-term-format` subcommand to `git bisect--helper` to call it\nfrom git-bisect.sh\n\nUsing `--check-term-format` subcommand is a temporary measure to port\nshell function to C so as to use the existing test suite. As more\nfunctions are ported, this subcommand will be retired and its\nimplementation will be called by some other method/subcommand. For\neg. In conversion of write_terms() of git-bisect.sh, the subcommand will\nbe removed and instead check_term_format() will be called in its C\nimplementation while a new subcommand will be introduced for write_terms().\n\nHelped-by: Johannes Schindelein <Johannes.Schindelein@gmx.de>\nMentored-by: Lars Schneider <larsxschneider@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Pranit Bauva <pranit.bauva@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/4ba1e5c4144bd268dafb252fd652dd37d9e4a1ed"},{"sha":"ecb3f3733cbeaf514508f97429863d33a6ac0d57","author":{"name":"Pranit Bauva","email":"40a45a699d3945bf6e080cdb09dfa314e9c99236@gmail.com"},"message":"bisect--helper: `write_terms` shell function in C\n\nReimplement the `write_terms` shell function in C and add a `write-terms`\nsubcommand to `git bisect--helper` to call it from git-bisect.sh . Also\nremove the subcommand `--check-term-format` as it can now be called from\ninside the function write_terms() C implementation.\n\nAlso `|| exit` is added when calling write-terms subcommand from\ngit-bisect.sh so as to exit whenever there is an error.\n\nUsing `--write-terms` subcommand is a temporary measure to port shell\nfunction to C so as to use the existing test suite. As more functions\nare ported, this subcommand will be retired and its implementation will\nbe called by some other method.\n\nMentored-by: Lars Schneider <larsxschneider@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Pranit Bauva <pranit.bauva@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/ecb3f3733cbeaf514508f97429863d33a6ac0d57"},{"sha":"fb71a329964da0892cc11cc94b5b379b0803ed92","author":{"name":"Pranit Bauva","email":"40a45a699d3945bf6e080cdb09dfa314e9c99236@gmail.com"},"message":"bisect--helper: `bisect_clean_state` shell function in C\n\nReimplement `bisect_clean_state` shell function in C and add a\n`bisect-clean-state` subcommand to `git bisect--helper` to call it from\ngit-bisect.sh .\n\nUsing `--bisect-clean-state` subcommand is a measure to port shell\nfunction to C so as to use the existing test suite. As more functions\nare ported, this subcommand will be retired but its implementation  will\nbe called by bisect_reset() and bisect_start().\n\nAlso introduce a function `mark_for_removal` to store the refs which\nneed to be removed while iterating through the refs.\n\nMentored-by: Lars Schneider <larsxschneider@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Pranit Bauva <pranit.bauva@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/fb71a329964da0892cc11cc94b5b379b0803ed92"},{"sha":"ba7eafe14621a9be80e41ecd1ff616bc66cbc1bf","author":{"name":"Pranit Bauva","email":"40a45a699d3945bf6e080cdb09dfa314e9c99236@gmail.com"},"message":"t6030: explicitly test for bisection cleanup\n\nAdd test to explicitly check that 'git bisect reset' is working as\nexpected. This is already covered implicitly by the test suite.\n\nMentored-by: Lars Schneider <larsxschneider@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Pranit Bauva <pranit.bauva@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/ba7eafe14621a9be80e41ecd1ff616bc66cbc1bf"},{"sha":"b903674b354bf1538a89833dbee27fe3a7105e48","author":{"name":"Pranit Bauva","email":"40a45a699d3945bf6e080cdb09dfa314e9c99236@gmail.com"},"message":"bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C\n\nReimplement `is_expected_rev` & `check_expected_revs` shell function in\nC and add a `--check-expected-revs` subcommand to `git bisect--helper` to\ncall it from git-bisect.sh .\n\nUsing `--check-expected-revs` subcommand is a temporary measure to port\nshell functions to C so as to use the existing test suite. As more\nfunctions are ported, this subcommand would be retired but its\nimplementation will be called by some other method.\n\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nMentored-by: Lars Schneider <larsxschneider@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Pranit Bauva <pranit.bauva@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/b903674b354bf1538a89833dbee27fe3a7105e48"},{"sha":"812d6b00750b56fc4b6a75277a30c628cc7be2ef","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"read-cache: drop explicit `CLOSE_LOCK`-flag\n\n`write_locked_index()` takes two flags: `COMMIT_LOCK` and `CLOSE_LOCK`.\nAt most one is allowed. But it is also possible to use no flag, i.e.,\n`0`. But when `write_locked_index()` calls `do_write_index()`, the\ntemporary file, a.k.a. the lockfile, will be closed. So passing `0` is\neffectively the same as `CLOSE_LOCK`, which seems like a bug.\n\nWe might feel tempted to restructure the code in order to close the file\nlater, or conditionally. It also feels a bit unfortunate that we simply\n\"happen\" to close the lock by way of an implementation detail of\nlockfiles. But note that we need to close the temporary file before\n`stat`-ing it, at least on Windows. See 9f41c7a6b (read-cache: close\nindex.lock in do_write_index, 2017-04-26).\n\nDrop `CLOSE_LOCK` and make it explicit that `write_locked_index()`\nalways closes the lock. Whether it is also committed is governed by the\nremaining flag, `COMMIT_LOCK`.\n\nThis means we neither have nor suggest that we have a mode to write the\nindex and leave the file open. Whatever extra contents we might\neventually want to write, we should probably write it from within\n`write_locked_index()` itself anyway.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/812d6b00750b56fc4b6a75277a30c628cc7be2ef"},{"sha":"df60cf5789782191b092169f86255aa44525b7d1","author":{"name":"Martin Ågren","email":"67b5f19b67bd3af99de34fd1ecd6ee0e3c0149c4@gmail.com"},"message":"read-cache: leave lock in right state in `write_locked_index()`\n\nIf the original version of `write_locked_index()` returned with an\nerror, it didn't roll back the lockfile unless the error occured at the\nvery end, during closing/committing. See commit 03b866477 (read-cache:\nnew API write_locked_index instead of write_index/write_cache,\n2014-06-13).\n\nIn commit 9f41c7a6b (read-cache: close index.lock in do_write_index,\n2017-04-26), we learned to close the lock slightly earlier in the\ncallstack. That was mostly a side-effect of lockfiles being implemented\nusing temporary files, but didn't cause any real harm.\n\nRecently, commit 076aa2cbd (tempfile: auto-allocate tempfiles on heap,\n2017-09-05) introduced a subtle bug. If the temporary file is deleted\n(i.e., the lockfile is rolled back), the tempfile-pointer in the `struct\nlock_file` will be left dangling. Thus, an attempt to reuse the\nlockfile, or even just to roll it back, will induce undefined behavior\n-- most likely a crash.\n\nBesides not crashing, we clearly want to make things consistent. The\nguarantees which the lockfile-machinery itself provides is A) if we ask\nto commit and it fails, roll back, and B) if we ask to close and it\nfails, do _not_ roll back. Let's do the same for consistency.\n\nDo not delete the temporary file in `do_write_index()`. One of its\ncallers, `write_locked_index()` will thereby avoid rolling back the\nlock. The other caller, `write_shared_index()`, will delete its\ntemporary file anyway. Both of these callers will avoid undefined\nbehavior (crashing).\n\nTeach `write_locked_index(..., COMMIT_LOCK)` to roll back the lock\nbefore returning. If we have already succeeded and committed, it will be\na noop. Simplify the existing callers where we now have a superfluous\ncall to `rollback_lockfile()`. That should keep future readers from\nwondering why the callers are inconsistent.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/peff/git/commits/df60cf5789782191b092169f86255aa44525b7d1"}]}
{"actor":{"display_login":"peff"}}