All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/25] Lockfile correctness and refactoring
@ 2014-04-14 13:54 Michael Haggerty
  2014-04-14 13:54 ` [PATCH v3 01/25] unable_to_lock_die(): rename function from unable_to_lock_index_die() Michael Haggerty
                   ` (25 more replies)
  0 siblings, 26 replies; 32+ messages in thread
From: Michael Haggerty @ 2014-04-14 13:54 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Johannes Sixt, Jeff King, Torsten Bögershausen,
	Eric Sunshine, Michael Haggerty

Round v3.  Thanks to Johannes Sixt and Peff for feedback on v2.  This
version addresses all issues raised for v1 [1] and v2 [2].

Changes since v2:

* Instead of keeping track of whether a lock_file object is active via
  a new bit in a flags bitmask, store it in a separate volatile
  sig_atomic_t struct member.  This makes it a little less undefined
  when this field is accessed by the signal handler.

* Add some other "volatile" qualifiers to values used by the signal
  handler.

* Define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN in cache.h and use
  them both inside and outside lockfile.c.  (In v2, only
  LOCK_SUFFIX_LEN was defined and it was only used within lockfile.c,
  because the other potential users in refs.c were rewritten anyway.
  But that rewriting is no longer included in the patch series, so it
  makes sense to define these constants as part of the public lockfile
  API.)

* Swap order of first two patches because the documentation lists
  unable_to_lock_die() under its new name.

* die() (instead of NOP) if commit_lock_file() is called for an
  unlocked lock_file object.

* Rebase to current master (there were no conflicts).

[1] http://thread.gmane.org/gmane.comp.version-control.git/245609
[2] http://thread.gmane.org/gmane.comp.version-control.git/245801

Michael Haggerty (25):
  unable_to_lock_die(): rename function from unable_to_lock_index_die()
  api-lockfile: expand the documentation
  rollback_lock_file(): do not clear filename redundantly
  rollback_lock_file(): set fd to -1
  lockfile: unlock file if lockfile permissions cannot be adjusted
  hold_lock_file_for_append(): release lock on errors
  lock_file(): always add lock_file object to lock_file_list
  lockfile.c: document the various states of lock_file objects
  cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN
  delete_ref_loose(): don't muck around in the lock_file's filename
  prepare_index(): declare return value to be (const char *)
  write_packed_entry_fn(): convert cb_data into a (const int *)
  lock_file(): exit early if lockfile cannot be opened
  remove_lock_file(): call rollback_lock_file()
  commit_lock_file(): inline temporary variable
  commit_lock_file(): die() if called for unlocked lockfile object
  lockfile: avoid transitory invalid states
  struct lock_file: declare some fields volatile
  try_merge_strategy(): remove redundant lock_file allocation
  try_merge_strategy(): use a statically-allocated lock_file object
  commit_lock_file(): use a strbuf to manage temporary space
  Change lock_file::filename into a strbuf
  resolve_symlink(): use a strbuf for internal scratch space
  resolve_symlink(): take a strbuf parameter
  trim_last_path_elm(): replace last_path_elm()

 Documentation/technical/api-lockfile.txt |  40 ++++-
 builtin/commit.c                         |  16 +-
 builtin/merge.c                          |  15 +-
 builtin/reflog.c                         |   2 +-
 builtin/update-index.c                   |   2 +-
 cache.h                                  |  15 +-
 config.c                                 |   6 +-
 lockfile.c                               | 275 ++++++++++++++++++-------------
 refs.c                                   |  29 ++--
 shallow.c                                |   6 +-
 10 files changed, 247 insertions(+), 159 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2014-04-16 19:51 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 13:54 [PATCH v3 00/25] Lockfile correctness and refactoring Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 01/25] unable_to_lock_die(): rename function from unable_to_lock_index_die() Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 02/25] api-lockfile: expand the documentation Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 03/25] rollback_lock_file(): do not clear filename redundantly Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 04/25] rollback_lock_file(): set fd to -1 Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 05/25] lockfile: unlock file if lockfile permissions cannot be adjusted Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 06/25] hold_lock_file_for_append(): release lock on errors Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 07/25] lock_file(): always add lock_file object to lock_file_list Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 08/25] lockfile.c: document the various states of lock_file objects Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 09/25] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 10/25] delete_ref_loose(): don't muck around in the lock_file's filename Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 11/25] prepare_index(): declare return value to be (const char *) Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 12/25] write_packed_entry_fn(): convert cb_data into a (const int *) Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 13/25] lock_file(): exit early if lockfile cannot be opened Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 14/25] remove_lock_file(): call rollback_lock_file() Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 15/25] commit_lock_file(): inline temporary variable Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 16/25] commit_lock_file(): die() if called for unlocked lockfile object Michael Haggerty
2014-04-15  6:49   ` Johannes Sixt
2014-04-16 15:17     ` Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 17/25] lockfile: avoid transitory invalid states Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 18/25] struct lock_file: declare some fields volatile Michael Haggerty
2014-04-15  6:55   ` Johannes Sixt
2014-04-16 15:36     ` Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 19/25] try_merge_strategy(): remove redundant lock_file allocation Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 20/25] try_merge_strategy(): use a statically-allocated lock_file object Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 21/25] commit_lock_file(): use a strbuf to manage temporary space Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 22/25] Change lock_file::filename into a strbuf Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 23/25] resolve_symlink(): use a strbuf for internal scratch space Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 24/25] resolve_symlink(): take a strbuf parameter Michael Haggerty
2014-04-14 13:54 ` [PATCH v3 25/25] trim_last_path_elm(): replace last_path_elm() Michael Haggerty
2014-04-15 18:40 ` [PATCH v3 00/25] Lockfile correctness and refactoring Torsten Bögershausen
2014-04-16 19:50   ` Michael Haggerty

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.