Skip to content

Stefan Beller git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11grep: handle corrupt index files earlybuiltin/grep.c+2 -10 replies
2/11repository: introduce repo_read_index_or_diebuiltin/add.c builtin/check-ignore.c builtin/clean.c +6 more+25 -1510 replies
3/11builtin/grep: use repo_read_index_or_diebuiltin/grep.c+1 -20 replies
4/11submodule: use repo_read_index_or_diesubmodule.c+1 -20 replies
5/11builtin/ls-files: use repo_read_index_or_diebuiltin/ls-files.c+3 -40 replies
6/11read_cache: use repo_read_index_or_die with different error messagesbuiltin/add.c builtin/commit.c builtin/rev-parse.c +1 more+11 -100 replies
7/11rerere: use repo_read_index_or_diererere.c+4 -62 replies
8/11check-attr: switch to repo_read_index_or_diebuiltin/check-attr.c+2 -30 replies
9/11checkout-index: switch to repo_read_indexbuiltin/checkout-index.c+2 -30 replies
10/11test helpers: switch to repo_read_index_or_diet/helper/test-dump-cache-tree.c t/helper/test-dump-untracked-cache.c t/helper/test-lazy-init-name-hash.c +3 more+16 -140 replies
11/11read_cache: convert most calls to repo_read_index_or_dieblame.c builtin/am.c builtin/diff.c +8 more+24 -153 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11]
Quoted 7 lines

If you have time, yes translate them all. I don't see how any of these strings are meant for script. If not, just _() the new string you added is fine.

With a majority of call sites dying like this though, I wonder if we should just add repo_read_index_or_die() with die() inside. Then the next person won't likely accidentally forget _()

So this comment tricked me into coming up with a patch series. :)

Each patch is themed, I tried to make each commit special w.r.t. reviewers attention.

We'd start out with a resend of the origin patch, which is boring.

Then we'll move all similar cases into one function (no-op for introducing the repo_read_index_or_die function as all callers will have the same error message and the same localisation).

Any following patch will be more controversial then the previous patches, I would expect, as we introduce more and more change.

The last patch is just an attempt to finish the series gracefully, and may contain errors (sometimes we do not want to die() in case of corrupt index).

Is this series roughly what you had in mind?

Thanks,
Stefan

Stefan Beller (11):
grep: handle corrupt index files early
repository: introduce repo_read_index_or_die builtin/grep: use repo_read_index_or_die
submodule: use repo_read_index_or_die
builtin/ls-files: use repo_read_index_or_die
read_cache: use repo_read_index_or_die with different error messages
rerere: use repo_read_index_or_die
check-attr: switch to repo_read_index_or_die
checkout-index: switch to repo_read_index
test helpers: switch to repo_read_index_or_die
read_cache: convert most calls to repo_read_index_or_die

 blame.c                              |  5 +++--
 builtin/add.c                        |  7 +++----
 builtin/am.c                         |  3 ++-
 builtin/check-attr.c                 |  5 ++---
 builtin/check-ignore.c               |  7 ++++---
 builtin/checkout-index.c             |  5 ++---
 builtin/clean.c                      |  4 ++--
 builtin/commit.c                     |  9 +++++----
 builtin/diff.c                       |  3 ++-
 builtin/fsck.c                       |  3 ++-
 builtin/grep.c                       |  2 +-
 builtin/ls-files.c                   |  7 +++----
 builtin/merge-index.c                |  3 ++-
 builtin/mv.c                         |  3 +--
 builtin/reset.c                      |  3 +--
 builtin/rev-parse.c                  |  4 ++--
 builtin/rm.c                         |  3 +--
 builtin/submodule--helper.c          |  3 +--
 check-racy.c                         |  2 +-
 diff.c                               |  5 +++--
 merge-recursive.c                    |  3 ++-
 merge.c                              |  4 ++--
 repository.c                         |  6 ++++++
 repository.h                         |  8 ++++++++
 rerere.c                             | 10 ++++------
 revision.c                           |  5 +++--
 sequencer.c                          |  5 +++--
 sha1-name.c                          |  2 +-
 submodule.c                          |  3 +--
 t/helper/test-dump-cache-tree.c      |  5 ++---
 t/helper/test-dump-untracked-cache.c |  4 ++--
 t/helper/test-lazy-init-name-hash.c  | 11 ++++++-----
 t/helper/test-read-cache.c           |  3 ++-
 t/helper/test-scrap-cache-tree.c     |  4 ++--
 t/helper/test-write-cache.c          |  3 ++-
 35 files changed, 89 insertions(+), 73 deletions(-)
Signature · 1 line
2.17.0.582.gccdcbd54c44.dirty