All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/21] replacement for dt/refs-backend-lmdb v7 patch 04/33
@ 2016-03-23 10:04 Michael Haggerty
  2016-03-23 10:04 ` [PATCH 01/21] t1430: test the output and error of some commands more carefully Michael Haggerty
                   ` (21 more replies)
  0 siblings, 22 replies; 31+ messages in thread
From: Michael Haggerty @ 2016-03-23 10:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, peff, pclouds, Ramsay Jones, Michael Haggerty

Patch 04/33 in David Turner's refs-backend-lmdb series v7 [1] did way
too much in a single patch, and in fact got a few minor things wrong.
Instead of that patch, I suggest this patch series, which

* Splits the changes into smaller steps.

* Adds a bunch of tests of deleting references with invalid but safe
  names, including symbolic references and including references
  reached via symbolic references. Two of these tests fail when run
  against David's patch 04 due to changes in output.

* Arranges for the "flags" argument to read_raw_ref() always to be
  non-NULL, which eliminates the need for a lot of "if (flags)"
  guards.

* Eliminates the now-superfluous "bad_name" local variable.

* Move the management of the scratch space sb_path from
  resolve_ref_unsafe() to read_raw_ref().

* Inlines resolve_ref_1() into resolve_ref_unsafe().

* Changes some callers of resolve_ref_unsafe() to pass flags=NULL
  instead of creating a local flags variable that is never used.

* Changes some callers to check for errors before using the return
  value of resolve_ref_unsafe().

I hope that the result is easier to understand and audit, even though
it consists of more patches (indeed, *because* of that).

This patch series applies on top of David's patch 03/33 the same place
David applied it in his repo [2]. It is also available in situ from my
GitHub repo [3] as branch "pluggable-backends-patch4"

If this series is used, later patches from David's series would need
to be rebased on top of it. This is a little bit messy but not
difficult; the result can be seen in branch
"pluggable-backends-rebased" in my GitHub repo [3] (albeit without
adjusting the LMDB-related patches).

Michael

[1] http://article.gmane.org/gmane.comp.version-control.git/287971
[2] https://github.com/dturner-tw/git/tree/dturner/pluggable-backends
[3] https://github.com/mhagger/git

David Turner (1):
  files-backend: break out ref reading

Michael Haggerty (20):
  t1430: test the output and error of some commands more carefully
  t1430: clean up broken refs/tags/shadow
  t1430: don't rely on symbolic-ref for creating broken symrefs
  t1430: test for-each-ref in the presence of badly-named refs
  t1430: improve test coverage of deletion of badly-named refs
  resolve_missing_loose_ref(): simplify semantics
  resolve_ref_unsafe(): use for loop to count up to MAXDEPTH
  resolve_ref_unsafe(): ensure flags is always set
  resolve_ref_1(): eliminate local variable
  resolve_ref_1(): reorder code
  resolve_ref_1(): eliminate local variable "bad_name"
  read_raw_ref(): manage own scratch space
  Inline resolve_ref_1() into resolve_ref_unsafe()
  read_raw_ref(): change flags parameter to unsigned int
  fsck_head_link(): remove unneeded flag variable
  cmd_merge(): remove unneeded flag variable
  get_default_remote(): remove unneeded flag variable
  checkout_paths(): remove unneeded flag variable
  check_aliased_update(): check that dst_name is non-NULL
  show_head_ref(): check the result of resolve_ref_namespace()

 builtin/checkout.c          |   3 +-
 builtin/fsck.c              |   3 +-
 builtin/merge.c             |   4 +-
 builtin/receive-pack.c      |   2 +-
 builtin/submodule--helper.c |   3 +-
 http-backend.c              |   4 +-
 refs/files-backend.c        | 341 ++++++++++++++++++++++++--------------------
 t/t1430-bad-ref-name.sh     | 132 +++++++++++++++--
 8 files changed, 312 insertions(+), 180 deletions(-)

-- 
2.8.0.rc3

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

end of thread, other threads:[~2016-04-01 17:55 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 10:04 [PATCH 00/21] replacement for dt/refs-backend-lmdb v7 patch 04/33 Michael Haggerty
2016-03-23 10:04 ` [PATCH 01/21] t1430: test the output and error of some commands more carefully Michael Haggerty
2016-03-23 10:04 ` [PATCH 02/21] t1430: clean up broken refs/tags/shadow Michael Haggerty
2016-03-23 10:04 ` [PATCH 03/21] t1430: don't rely on symbolic-ref for creating broken symrefs Michael Haggerty
2016-03-23 10:04 ` [PATCH 04/21] t1430: test for-each-ref in the presence of badly-named refs Michael Haggerty
2016-03-23 10:04 ` [PATCH 05/21] t1430: improve test coverage of deletion " Michael Haggerty
2016-03-23 10:04 ` [PATCH 06/21] resolve_missing_loose_ref(): simplify semantics Michael Haggerty
2016-03-23 10:04 ` [PATCH 07/21] resolve_ref_unsafe(): use for loop to count up to MAXDEPTH Michael Haggerty
2016-03-23 10:04 ` [PATCH 08/21] resolve_ref_unsafe(): ensure flags is always set Michael Haggerty
2016-03-23 10:04 ` [PATCH 09/21] resolve_ref_1(): eliminate local variable Michael Haggerty
2016-03-23 10:04 ` [PATCH 10/21] resolve_ref_1(): reorder code Michael Haggerty
2016-03-23 10:04 ` [PATCH 11/21] resolve_ref_1(): eliminate local variable "bad_name" Michael Haggerty
2016-03-23 10:04 ` [PATCH 12/21] files-backend: break out ref reading Michael Haggerty
2016-03-23 10:04 ` [PATCH 13/21] read_raw_ref(): manage own scratch space Michael Haggerty
2016-03-23 10:04 ` [PATCH 14/21] Inline resolve_ref_1() into resolve_ref_unsafe() Michael Haggerty
2016-03-23 10:04 ` [PATCH 15/21] read_raw_ref(): change flags parameter to unsigned int Michael Haggerty
2016-03-23 10:04 ` [PATCH 16/21] fsck_head_link(): remove unneeded flag variable Michael Haggerty
2016-03-23 10:04 ` [PATCH 17/21] cmd_merge(): " Michael Haggerty
2016-03-23 10:04 ` [PATCH 18/21] get_default_remote(): " Michael Haggerty
2016-03-23 10:04 ` [PATCH 19/21] checkout_paths(): " Michael Haggerty
2016-03-23 10:04 ` [PATCH 20/21] check_aliased_update(): check that dst_name is non-NULL Michael Haggerty
2016-03-23 10:04 ` [PATCH 21/21] show_head_ref(): check the result of resolve_ref_namespace() Michael Haggerty
2016-03-24  6:47 ` [PATCH 00/21] replacement for dt/refs-backend-lmdb v7 patch 04/33 David Turner
2016-03-27  5:22   ` Michael Haggerty
2016-03-29 20:12     ` David Turner
2016-03-30  6:37       ` Michael Haggerty
2016-03-30 20:05         ` David Turner
2016-03-31 16:14           ` Michael Haggerty
2016-03-31 22:22             ` David Turner
2016-04-01  1:37           ` Stefan Beller
2016-04-01 17:55             ` David Turner

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.