Skip to content

RFC several notes refs, post-rewrite, notes rewriting

Thomas Rast git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 RFC Latest12 patches 7 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12Support showing notes from more than one notes treeDocumentation/config.txt notes.c notes.h +5 more+181 -291 reply
2/12Documentation: document post-rewrite hookDocumentation/githooks.txt+36 -00 replies
3/12commit --amend: invoke post-rewrite hookbuiltin-commit.c git-rebase--interactive.sh t/t5407-post-rewrite-hook.sh+96 -11 reply
4/12rebase: invoke post-rewrite hookgit-am.sh git-rebase.sh t/t5407-post-rewrite-hook.sh+45 -00 replies
5/12rebase -i: invoke post-rewrite hookgit-rebase--interactive.sh t/t5407-post-rewrite-hook.sh+117 -00 replies
6/12notes: implement 'git notes copy --stdin'Documentation/git-notes.txt builtin-notes.c notes.c +2 more+129 -21 reply
7/12notes: implement helpers needed for note copying during rewriteDocumentation/config.txt Documentation/git-notes.txt Documentation/githooks.txt +3 more+277 -91 reply
8/12rebase: support automatic notes copyinggit-am.sh git-rebase--interactive.sh git-rebase.sh +2 more+37 -10 replies
9/12commit --amend: copy notes to the new commitbuiltin-commit.c t/t7501-commit.sh+18 -00 replies
10/12filter-branch: invoke post-rewrite hookDocumentation/git-filter-branch.txt git-filter-branch.sh t/t5407-post-rewrite-hook.sh+55 -10 replies
11/12filter-branch: learn how to filter notesDocumentation/config.txt Documentation/git-filter-branch.txt Documentation/githooks.txt +2 more+62 -70 replies
12/12notes: add shorthand --ref to override GIT_NOTES_REFDocumentation/git-notes.txt builtin-notes.c+10 -00 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohan Herland
SeriesA-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [RFC PATCH v3 00/12] several notes refs, post-rewrite, notes rewriting
Quoted 1 line

I'm running out of git time today

I should repeat that incantation more often, it mysteriously freed up more time.

Brief overview of changes since v2, with some inline questions about things that need to be settled:

* new [1/12] "Support showing notes from more than one notes tree" that teaches a "notes.displayRef" option which can glob for notes that should be shown, and can be specified more than once.

- maybe we should default this to "refs/notes/*"?

- currently git-notes and the configs don't agree on what is a valid notes ref. git-notes refuses even *showing* outside of refs/notes/. I tend towards changing git-notes at least as far as reading notes is concerned (show/list), so that remote notes work.

* dropped [5/11] "notes: clean up t3301" as per Junio's comments

* changed [7/12] "notes: implement helpers needed for note copying during rewrite" to support "notes.rewriteRef" as announced earlier. "notes.rewrite.<cmd>" now default to true, so that you only need to enable one, namely set notes.rewriteRef = refs/notes/*.

- do we want a default?

- do we want the rewriteRefs to also implicitly be displayRefs?

- the "notes.rewriteMode = overwrite for notes/volatile/*" hinted at earlier is missing. Does anyone need that?

* new [12/12] "notes: add shorthand --ref to override GIT_NOTES_REF"

I haven't changed [10/12] & [11/12] "filter-branch..." yet, as I'm not really sure what the best format of such a filter would be.

The existing code is probably a neat way of editing the notes, but it creates a new commit to the notes ref for every rewritten commit. If I change the default --notes-filter to cope with multi-rewriting, this means a new notes commit per rewritten commit. Seems rather wasteful just to salvage your notes across an otherwise unrelated filter-branch.

So the obvious fix would seem to be a --post-rewrite addition that just pipes through 'git notes copy --for-rewrite=filter-branch', but that's again not very customizable short of reinventing the whole thing. Any ideas?

Thomas Rast (12):
Support showing notes from more than one notes tree
Documentation: document post-rewrite hook
commit --amend: invoke post-rewrite hook
rebase: invoke post-rewrite hook
rebase -i: invoke post-rewrite hook
notes: implement 'git notes copy --stdin'
notes: implement helpers needed for note copying during rewrite
rebase: support automatic notes copying
commit --amend: copy notes to the new commit
filter-branch: invoke post-rewrite hook
filter-branch: learn how to filter notes
notes: add shorthand --ref to override GIT_NOTES_REF

 Documentation/config.txt            |   40 +++++++-
 Documentation/git-filter-branch.txt |   20 +++-
 Documentation/git-notes.txt         |   20 +++-
 Documentation/githooks.txt          |   40 +++++++
 builtin-commit.c                    |   49 ++++++++
 builtin-notes.c                     |  168 +++++++++++++++++++++++++++-
 builtin.h                           |   16 +++
 git-am.sh                           |   13 ++
 git-filter-branch.sh                |   37 ++++++
 git-rebase--interactive.sh          |   45 +++++++-
 git-rebase.sh                       |    6 +
 notes.c                             |  125 +++++++++++++++++++-
 notes.h                             |   16 +++
 pretty.c                            |    6 +-
 refs.c                              |    4 +-
 refs.h                              |    5 +
 t/t3301-notes.sh                    |  213 ++++++++++++++++++++++++++++++++--
 t/t3306-notes-prune.sh              |    6 +-
 t/t3400-rebase.sh                   |   17 +++
 t/t3404-rebase-interactive.sh       |   11 ++
 t/t5407-post-rewrite-hook.sh        |  188 ++++++++++++++++++++++++++++++
 t/t7003-filter-branch.sh            |   22 ++++
 t/t7501-commit.sh                   |   12 ++
 23 files changed, 1046 insertions(+), 33 deletions(-)
 create mode 100755 t/t5407-post-rewrite-hook.sh