git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/5] getting rid of most "static struct lock_file"s
@ 2018-05-06 14:10 Martin Ågren
  2018-05-08 18:25 ` Jeff King
  0 siblings, 1 reply; 11+ messages in thread
From: Martin Ågren @ 2018-05-06 14:10 UTC (permalink / raw)
  To: git

This series addresses two classes of "static struct lock_file", removing
the staticness: Those locks that already live inside a function, and
those that can simply be moved into the function they are used from.

The first three patches are some cleanups I noticed along the way, where
we first take a lock using LOCK_DIE_ON_ERROR, then check whether we got
it.

After this series, we have a small number of "static struct lock_file"
left, namely those locks that are used from within more than one
function. Thus, after this series, when one stumbles upon a static
lock_file, it should be a clear warning that the lock is being
used by more than one function.

Martin

Martin Ågren (5):
  t/helper/test-write-cache: clean up lock-handling
  refs.c: do not die if locking fails in `write_pseudoref()`
  refs.c: drop dead code checking lock status in `delete_pseudoref()`
  lock_file: make function-local locks non-static
  lock_file: move static locks into functions

 t/helper/test-scrap-cache-tree.c |  4 ++--
 t/helper/test-write-cache.c      | 14 +++++---------
 apply.c                          |  2 +-
 builtin/add.c                    |  3 +--
 builtin/describe.c               |  2 +-
 builtin/difftool.c               |  2 +-
 builtin/gc.c                     |  2 +-
 builtin/merge.c                  |  4 ++--
 builtin/mv.c                     |  2 +-
 builtin/read-tree.c              |  3 +--
 builtin/receive-pack.c           |  2 +-
 builtin/rm.c                     |  3 +--
 bundle.c                         |  2 +-
 fast-import.c                    |  2 +-
 refs.c                           | 12 ++++--------
 refs/files-backend.c             |  2 +-
 rerere.c                         |  3 +--
 shallow.c                        |  2 +-
 18 files changed, 27 insertions(+), 39 deletions(-)

-- 
2.17.0.411.g9fd64c8e46


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

end of thread, other threads:[~2018-05-10  7:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-06 14:10 [PATCH 0/5] getting rid of most "static struct lock_file"s Martin Ågren
2018-05-08 18:25 ` Jeff King
2018-05-09 20:55   ` [PATCH v2 " Martin Ågren
2018-05-09 20:55     ` [PATCH v2 1/5] t/helper/test-write-cache: clean up lock-handling Martin Ågren
2018-05-09 20:55     ` [PATCH v2 2/5] refs.c: do not die if locking fails in `write_pseudoref()` Martin Ågren
2018-05-09 20:55     ` [PATCH v2 3/5] refs.c: do not die if locking fails in `delete_pseudoref()` Martin Ågren
2018-05-09 20:55     ` [PATCH v2 4/5] lock_file: make function-local locks non-static Martin Ågren
2018-05-09 20:55     ` [PATCH v2 5/5] lock_file: move static locks into functions Martin Ågren
2018-05-10  5:21     ` [PATCH v2 0/5] getting rid of most "static struct lock_file"s Jeff King
2018-05-10  6:01       ` Junio C Hamano
2018-05-10  7:47         ` Martin Ågren

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).