GitHub PushEvent at 2014-05-19 18:38:22
Repository: git
Actor: rsahlberg
Payload: {"shas":[["373570a6c254451a5244bc07713543439857b365","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: add transaction.status and track OPEN/CLOSED/ERROR\n\nTrack the status of a transaction in a new status field. Check the field for\nsanity, i.e. that status must be OPEN when _commit/_create/_delete or\n_update is called or else die(BUG:...)\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["a5253b1360eedc60295d90b91df7b8355e35bb65","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","tag.c: use ref transactions when doing updates\n\nChange tag.c to use ref transactions for all ref updates.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["d329fd6c44223d8f16d17ae05eb4eea9808a62ba","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","replace.c: use the ref transaction functions for updates\n\nUpdate replace.c to use ref transactions for updates.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["33a9f2ae558c6c6a092e7d1d40b275b7166de89a","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","commit.c: use ref transactions for updates\n\nChange commit.c to use ref transactions for all ref updates.\nMake sure we pass a NULL pointer to ref_transaction_update if have_old\nis false.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["2a857b926b77bb6456c07a64eeb3125b7179c279","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","sequencer.c: use ref transactions for all ref updates\n\nChange to use ref transactions for all updates to refs.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["78875e1f78fed6398557eec68499b7061740755c","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","fast-import.c: change update_branch to use ref transactions\n\nChange update_branch() to use ref transactions for updates.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["f8b886a6d6cbaab84c0cf9c615a864dd2efd1f9d","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","branch.c: use ref transaction for all ref updates\n\nChange create_branch to use a ref transaction when creating the new branch.\n\nThis also fixes a race condition in the old code where two concurrent\ncreate_branch could race since the lock_any_ref_for_update/write_ref_sha1\ndid not protect against the ref already existing. I.e. one thread could end up\noverwriting a branch even if the forcing flag is false.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["849e4f0858e58d6e71a1fbdaed944ec49d2d0a9d","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: change update_ref to use a transaction\n\nChange the update_ref helper function to use a ref transaction internally.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["e82b4a2064178d0b2e61cfa6d4f27b32d619123e","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: ref_transaction_commit should not free the transaction\n\nChange ref_transaction_commit so that it does not free the transaction.\nInstead require that a caller will end a transaction by calling\nref_transaction_free.\n\nBy having the transaction object remaining valid after _commit returns allows\nus to write much nicer code and still be able to call ref_transaction_free\nsafely. Instead of this horribleness\n\tt = ref_transaction_begin();\n\tif ((!t ||\n\t    ref_transaction_update(t, refname, sha1, oldval, flags,\n\t\t\t\t   !!oldval)) ||\n\t    (ref_transaction_commit(t, action, &err) && !(t = NULL))) {\n\t\tref_transaction_free(t);\n\nwe can now just do the much nicer\n\tt = ref_transaction_begin();\n\tif (!t ||\n\t    ref_transaction_update(t, refname, sha1, oldval, flags,\n\t\t\t\t   !!oldval) ||\n\t    ref_transaction_commit(&t, action, &err)) {\n\t\tref_transaction_free(t);\n\t\t... die/return ...\n\n\tref_transaction_free(transaction);\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["517c31cba20180c001e4febcf9a195949d4e4a13","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","receive-pack.c: use a reference transaction for updating the refs\n\nWrap all the ref updates inside a transaction to make the update atomic.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["137de1b6301765efd36c37d584d488bdcb3b7a59","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","fast-import.c: use a ref transaction when dumping tags\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["c92b6d76af819809657105f04032aac39d6391c6","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","walker.c: use ref transaction for ref updates\n\nSwitch to using ref transactions in walker_fetch(). As part of the refactoring\nto use ref transactions we also fix a potential memory leak where in the\noriginal code if write_ref_sha1() would fail we would end up returning from\nthe function without free()ing the msg string.\n\nThis changes the locking slightly for walker_fetch. Previously the code would\nlock all refs before writing them but now we do not lock the refs until the\ncommit stage. There is thus a very short window where changes could be done\nlocally during the fetch which would be overwritten when the fetch completes\nand commits its transaction. But this window should be reasonably short.\nEven if this race does trigger, since both the old code and the new code\njust overwrites the refs to the new values without checking or comparing\nthem with the previous value, this is not too dissimilar to a similar scenario\nwhere you first do a ref change locally and then later do a fetch that\noverwrites the local change. With this in mind I do not see the change in\nlocking semantics to be critical.\n\nNote that this function is only called when fetching from a remote HTTP\nrepository onto the local (most of the time single-user) repository which\nlikely means that the type of collissions that the previous locking would\nprotect against and cause the fetch to fail for to be even more rare.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["3b472e1c8e8e657aeb9688b776e9cd7cb6b570b3","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: make lock_ref_sha1 static\n\nNo external callers reference lock_ref_sha1 any more so lets declare it static.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["dba1b21daec8beb1eff9e7002fb8a9a97de8ac3d","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: remove the update_ref_lock function\n\nSince we now only call update_ref_lock with onerr==QUIET_ON_ERR we no longer\nneed this function and can replace it with just calling lock_any_ref_for_update\ndirectly.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["cee86d7165ae849fcb03f61d78ef069a61ffdea7","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: remove the update_ref_write function\n\nSince we only call update_ref_write from a single place and we only call it\nwith onerr==QUIET_ON_ERR we can just as well get rid of it and just call\nwrite_ref_sha1 directly.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["ae42c68c0d73c4405fb3248009d45117b530d286","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: remove lock_ref_sha1\n\nlock_ref_sha1 was only called from one place in refc.c and only provided\na check that the refname was sane before adding back the initial \"refs/\"\npart of the ref path name, the initial \"refs/\" that this caller had already\nstripped off before calling lock_ref_sha1.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["a8c93d13d82e54317fddb75dfd73de00b978ed3b","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: make prune_ref use a transaction to delete the ref\n\nChange prune_ref to delete the ref using a ref transaction. To do this we also\nneed to add a new flag REF_ISPRUNING that will tell the transaction that we\ndo not want to delete this ref from the packed refs. This flag is private to\nrefs.c and not exposed to external callers.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["f4e5b8b8b441e419c43c216d0704d134b0bb222c","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: make delete_ref use a transaction\n\nChange delete_ref to use a ref transaction for the deletion. At the same time\nsince we no longer have any callers of repack_without_ref we can now delete\nthis function.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["647791aea269a971058cb9bc4b79ebf74b21981e","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: pass the ref log message to _create/delete/update instead of _commit\n\nChange the reference transactions so that we pass the reflog message\nthrough to the create/delete/update function instead of the commit message.\nThis allows for individual messages for each change in a multi ref\ntransaction.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true],["1a98b337e45a3a8ac7be8b06c8d09662fd9b03b6","2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com","refs.c: pass NULL as *flags to read_ref_full\n\nWe call read_ref_full with a pointer to flags from rename_ref but since\nwe never actually use the returned flags we can just pass NULL here instead.\n\nSigned-off-by: Ronnie Sahlberg <sahlberg@google.com>","Ronnie Sahlberg",true]],"size":30,"ref":"refs/heads/ref-transactions","head":"16c933f3e8e0a9f44ce0e28b74908488b47051b7"}