rs/ref-transaction ("Use ref transactions", part 3)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v23 Latest25 patches 2 repliesIn review
- v22 posting 2/224 patches 8 repliesSuperseded
- v2119 patches 18 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v22 posting 1/2 | 22 patches | 0 replies | Superseded | |
| v1 | 20 patches | 2 replies | Superseded |
Patches in v23 No applies recorded yet
Reviews trailers per patch
12 of 25 patches have a Reviewed-by or Acked-by.
| Patch | Ronnie Sahlberg | Michael Haggerty |
|---|---|---|
| 1/25 | R-b | |
| 2/25 | ||
| 3/25 | ||
| 4/25 | R-b | |
| 5/25 | ||
| 6/25 | ||
| 7/25 | R-b | |
| 8/25 | R-b | |
| 9/25 | R-b | |
| 10/25 | ||
| 11/25 | ||
| 12/25 | ||
| 13/25 | ||
| 14/25 | ||
| 15/25 | R-b | |
| 16/25 | R-b | |
| 17/25 | ||
| 18/25 | R-b | |
| 19/25 | ||
| 20/25 | ||
| 21/25 | ||
| 22/25 | R-b | |
| 23/25 | R-b | |
| 24/25 | R-b | |
| 25/25 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v23 0/25] rs/ref-transaction ("Use ref transactions", part 3)
This series by Ronnie was last seen on-list at [1]. It includes some improvements to the ref-transaction API, improves handling of poorly named refs (which should make it easier to tighten the refname format checks in the future), and is a stepping stone toward later series that use the ref-transaction API more and make it support alternate backends (yay!).
The changes since (a merge of 'master' and) v22 are very minor and can be seen below[2]. The more important change is that it's rebased against current 'master'.
Review comments from Michael and Junio were very helpful in getting this in shape. Thanks much to both.
The series can also be found at
git://repo.or.cz/git/jrn.git tags/rs/ref-transaction
It is based against current 'master' (670a3c1d, 2014-10-14) and intended for 'next'.
Thoughts welcome, as always. Improvements preferred in the form of patches on top of the series.
Jonathan Nieder (6):
mv test: recreate mod/ directory instead of relying on stale copy branch -d: avoid repeated symref resolution
packed-ref cache: forbid dot-components in refnames refs.c: do not permit err == NULL
lockfile: remove unable_to_lock_error
ref_transaction_commit: bail out on failure to remove a ref
Junio C Hamano (1):
reflog test: test interaction with detached HEAD
Ronnie Sahlberg (18):
wrapper.c: remove/unlink_or_warn: simplify, treat ENOENT as success refs.c: lock_ref_sha1_basic is used for all refs wrapper.c: add a new function unlink_or_msg
refs.c: add an err argument to delete_ref_loose
refs.c: pass the ref log message to _create/delete/update instead of
_commit
rename_ref: don't ask read_ref_full where the ref came from refs.c: refuse to lock badly named refs in lock_ref_sha1_basic refs.c: call lock_ref_sha1_basic directly from commit refs.c: pass a list of names to skip to is_refname_available refs.c: ref_transaction_commit: distinguish name conflicts from other
errors
fetch.c: change s_update_ref to use a ref transaction refs.c: make write_ref_sha1 static
refs.c: change resolve_ref_unsafe reading argument to be a flags field branch -d: simplify by using RESOLVE_REF_READING
test: put tests for handling of bad ref names in one place refs.c: allow listing and deleting badly named refs
for-each-ref: skip and warn about broken ref names
remote rm/prune: print a message when writing packed-refs fails
branch.c | 6 +- builtin/blame.c | 2 +- builtin/branch.c | 22 ++- builtin/checkout.c | 6 +- builtin/clone.c | 2 +- builtin/commit.c | 6 +- builtin/fetch.c | 34 ++-- builtin/fmt-merge-msg.c | 2 +- builtin/for-each-ref.c | 11 +- builtin/fsck.c | 2 +- builtin/log.c | 3 +- builtin/merge.c | 2 +- builtin/notes.c | 2 +- builtin/receive-pack.c | 9 +- builtin/remote.c | 20 ++- builtin/replace.c | 5 +- builtin/show-branch.c | 7 +- builtin/symbolic-ref.c | 2 +- builtin/tag.c | 4 +- builtin/update-ref.c | 13 +- bundle.c | 2 +- cache.h | 44 +++-- fast-import.c | 8 +- git-compat-util.h | 16 +- http-backend.c | 4 +- lockfile.c | 10 -- lockfile.h | 1 - notes-merge.c | 2 +- reflog-walk.c | 5 +- refs.c | 446 ++++++++++++++++++++++++++++++++--------------- refs.h | 44 +++-- remote.c | 11 +- sequencer.c | 8 +- t/t1400-update-ref.sh | 62 +++---- t/t1413-reflog-detach.sh | 70 ++++++++ t/t1430-bad-ref-name.sh | 207 ++++++++++++++++++++++ t/t3200-branch.sh | 9 + t/t7001-mv.sh | 15 +- t/t9300-fast-import.sh | 30 ---- transport-helper.c | 5 +- transport.c | 5 +- upload-pack.c | 2 +- walker.c | 5 +- wrapper.c | 28 ++- wt-status.c | 2 +- 45 files changed, 850 insertions(+), 351 deletions(-) create mode 100755 t/t1413-reflog-detach.sh create mode 100755 t/t1430-bad-ref-name.sh
[1] http://thread.gmane.org/gmane.comp.version-control.git/254501/focus=257771
[2]
cache.h | 11 ++++--- git-compat-util.h | 4 +-- refs.c | 96 +++++++++++++++++++++++++++++-------------------------- refs.h | 6 +++- 4 files changed, 64 insertions(+), 53 deletions(-)
cache.h +7 -4
@@ -983,7 +983,8 @@ extern int read_ref(const char *refname, unsigned char *sha1);* packed references), REF_ISSYMREF (if the initial reference was a * symbolic reference), REF_BAD_NAME (if the reference name is ill * formed --- see RESOLVE_REF_ALLOW_BAD_NAME below), and REF_ISBROKEN -* (if the ref is malformed). +* (if the ref is malformed or has a bad name). See refs.h for more detail +* on each flag. * * If ref is not a properly-formatted, normalized reference, return * NULL. If more than MAXDEPTH recursive symbolic lookups are needed,
@@ -991,12 +992,14 @@ extern int read_ref(const char *refname, unsigned char *sha1);* * RESOLVE_REF_ALLOW_BAD_NAME allows resolving refs even when their * name is invalid according to git-check-ref-format(1). If the name -* is bad then the value stored in sha1 will be null_sha1 and the -* REF_ISBROKEN and REF_BAD_NAME flags will be set. +* is bad then the value stored in sha1 will be null_sha1 and the two +* flags REF_ISBROKEN and REF_BAD_NAME will be set. * * Even with RESOLVE_REF_ALLOW_BAD_NAME, names that escape the refs/ * directory and do not consist of all caps and underscores cannot be -* resolved. The function returns NULL for such ref names. +* resolved. The function returns NULL for such ref names. +* Caps and underscores refers to the special refs, such as HEAD, +* FETCH_HEAD and friends, that all live outside of the refs/ directory. */ #define RESOLVE_REF_READING 0x01#define RESOLVE_REF_NO_RECURSE 0x02
git-compat-util.h +2 -2
@@ -779,7 +779,7 @@ void git_qsort(void *base, size_t nmemb, size_t size,/* * Preserves errno, prints a message, but gives no warning for ENOENT. -* Returns 0 on success which includes trying to unlink an object that does +* Returns 0 on success, which includes trying to unlink an object that does * not exist. */ int unlink_or_warn (const char *path);
@@ -792,7 +792,7 @@ int unlink_or_warn(const char *path);int unlink_or_msg (const char *file,struct strbuf *err);/* * Preserves errno, prints a message, but gives no warning for ENOENT. -* Returns 0 on success which includes trying to remove a directory that does +* Returns 0 on success, which includes trying to remove a directory that does * not exist. */ int rmdir_or_warn (const char *path);
refs.c +50 -46
194 lines not on this page · raw message
refs.h +5 -1
@@ -62,7 +62,11 @@ struct ref_transaction;*/ #define REF_ISBROKEN 0x04 -/* Reference name is not well formed (see git-check-ref-format(1)). */ +/* +* Reference name is not well formed. +* +* See git-check-ref-format(1) for the definition of well formed ref names. +*/ #define REF_BAD_NAME 0x08/*