[PATCH] Indent code with TABs

2018-12-06 Thread Nguyễn Thái Ngọc Duy
as upstream as possible. The latter pretty much has separate maintainers, it's up to them to decide. Signed-off-by: Nguyễn Thái Ngọc Duy --- Should be quite safe to merge since "git diff -b" is empty archive-tar.c | 2 +- archive.c | 4 +- builtin/add.c | 2 +

[PATCH v3 14/14] doc: promote "git switch-branch" and "git restore-files"

2018-11-29 Thread Nguyễn Thái Ngọc Duy
des documentation, suggestions/advice from other commands... "git checkout" is also removed from "git help" (i.e. it's no longer considered a commonly used command) Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config/advice.txt| 10 +++-- Documentation/co

[PATCH v3 05/14] checkout: move 'confict_style' and 'dwim_..' to checkout_opts

2018-11-29 Thread Nguyễn Thái Ngọc Duy
These local variables are referenced by struct option[]. This struct will soon be broken down, moved away and we can't rely on local variables anymore. Move these two to struct checkout_opts in preparation for that. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 16

[PATCH v3 11/14] switch-branch: only allow explicit detached HEAD

2018-11-29 Thread Nguyễn Thái Ngọc Duy
of (until you know better). To keep switch-branch a bit more friendly to new users, we only allow entering detached HEAD mode when --detach is given. "git switch-branch" must take a branch (unless you create a new branch, then of course switch-branch can take any commit-ish) Signed-off-

[PATCH v3 04/14] checkout: make "opts" in cmd_checkout() a pointer

2018-11-29 Thread Nguyễn Thái Ngọc Duy
"opts" will soon be moved out of cmd_checkout(). To keep changes in that patch smaller, convert "opts" to a pointer and keep the real thing behind "real_opts". Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 109 +++

[PATCH v3 02/14] git-checkout.txt: split detached head section out

2018-11-29 Thread Nguyễn Thái Ngọc Duy
This is to be reused by the coming git-switch-branch.txt man page which also deals with detached HEAD. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/detach-head.txt | 132 Documentation/git-checkout.txt | 133 + 2 files

[PATCH v3 12/14] restore-files: take tree-ish from --from option instead

2018-11-29 Thread Nguyễn Thái Ngọc Duy
ing. With accept_ref being unset, dwim can't happen. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 41 ++--- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index fbfebba2d9..7ff9951818

[PATCH v3 08/14] switch-branch: better names for -b and -B

2018-11-29 Thread Nguyễn Thái Ngọc Duy
The shortcut of these options do not make much sense when used with switch-branch. And their descriptions are also tied to checkout out. Move -b/-B to cmd_checkout() and new -c/-C with the same functionality in cmd_switch_branch() Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 30

[PATCH v3 06/14] checkout: split options[] array in three pieces

2018-11-29 Thread Nguyễn Thái Ngọc Duy
are separate. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 77 +- parse-options-cb.c | 16 ++ parse-options.h| 3 +- 3 files changed, 73 insertions(+), 23 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index

[PATCH v3 13/14] restore-files: make pathspec mandatory

2018-11-29 Thread Nguyễn Thái Ngọc Duy
the scope of restore they want. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index 7ff9951818..961a90b1c0 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -59,6 +59,7 @@ struct che

[PATCH v3 09/14] switch-branch: stop accepting pathspec

2018-11-29 Thread Nguyễn Thái Ngọc Duy
This command is about switching branch (or creating a new one) and should not accept pathspec. This helps simplify ambiguation handling. The other two ("git checkout" and "git restore-files") of course do accept pathspec as before. Signed-off-by: Nguyễn Thái Ngọc Duy --- bui

[PATCH v3 03/14] checkout: factor out some code in parse_branchname_arg()

2018-11-29 Thread Nguyễn Thái Ngọc Duy
This is in preparation for the new command restore-files, which also needs to parse opts->source_tree but does not need all the disambiguation logic. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 51 -- 1 file changed, 31 inserti

[PATCH v3 07/14] checkout: split into switch-branch and restore-files

2018-11-29 Thread Nguyễn Thái Ngọc Duy
ll (or most of users) are sick of it. See the new man pages for the final design of these commands. The actual implementation though is still pretty much the same as "git checkout". Following patches will adjust their behavior to match the man pages. Signed-off-by: Nguyễn

[PATCH v3 10/14] switch-branch: reject "do nothing" case

2018-11-29 Thread Nguyễn Thái Ngọc Duy
he current branch - create a new branch Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index 880030e929..c7ae068d2c 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -56,6 +56,7

[PATCH v3 01/14] git-checkout.txt: fix one syntax line

2018-11-29 Thread Nguyễn Thái Ngọc Duy
if exists, for the current branch. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-checkout.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 801de2f764..65bd1bc50d 100644 --- a/Documentation/git-ch

[PATCH/RFC v3 00/14] Introduce new commands switch-branch and restore-files

2018-11-29 Thread Nguyễn Thái Ngọc Duy
dental overwrites) are of course still missing. But they are coming. I did not go replace "detached HEAD" with "unnamed branch" (or "no branch") everywhere because I think a unique term is still good to refer to this concept. Or maybe "no branch" is good enou

[PATCH v2 3/7] checkout: move 'confict_style' to checkout_opts

2018-11-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 31245c1eb4..211a347a0c 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -55,6 +55,7 @@ struct

[PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-27 Thread Nguyễn Thái Ngọc Duy
h, but it will never touch HEAD or the ref it points to. The good old "git checkout" command is still here and will be until all (or most of users) are sick of it. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin.h | 2 + builtin/checkout.c | 91 +++

[PATCH v2 5/7] checkout: split options[] array in three pieces

2018-11-27 Thread Nguyễn Thái Ngọc Duy
are separate. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 80 -- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index a50c51f287..d9dbd2d40d 100644 --- a/builtin/checkout.c +++ b/builtin

[PATCH v2 2/7] checkout: make "opts" in cmd_checkout() a pointer

2018-11-27 Thread Nguyễn Thái Ngọc Duy
"opts" will soon be moved out of cmd_checkout(). To keep changes in that patch smaller, convert "opts" to a pointer and keep the real thing behind "real_opts". Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 109 +++

[PATCH v2 1/7] parse-options: allow parse_options_concat(NULL, options)

2018-11-27 Thread Nguyễn Thái Ngọc Duy
ts, opts_2); Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options-cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse-options-cb.c b/parse-options-cb.c index 8c9edce52f..c609d52926 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@ -126,7 +126,7 @@ str

[PATCH/RFC v2 0/7] Introduce new commands switch-branch and checkout-files

2018-11-27 Thread Nguyễn Thái Ngọc Duy
checkout-files [--from=] Oh and of course I'll be waiting for the new --index from Thomas before submitting submitting any thing serious for 'next'. We still have plenty of time. Nguyễn Thái Ngọc Duy (7): parse-options: allow parse_options_concat(NULL, options) checkout: make "opts&qu

[PATCH v2 7/7] Suggest other commands instead of "git checkout"

2018-11-27 Thread Nguyễn Thái Ngọc Duy
The assumption made is here - "git checkout" is a horrible monster that should only be touched with a two-meter pole - there are other commands that can achieve the same thing Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-branch.txt | 8 ++-- Documentation

[PATCH v2 4/7] checkout: move dwim_new_local_branch to checkout_opts

2018-11-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 211a347a0c..a50c51f287 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -44,6 +44,8 @@ struct

[PATCH] transport-helper.c: do not translate a string twice

2018-11-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- My bad. transport-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport-helper.c b/transport-helper.c index 7213fa0d32..bf225c698f 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -573,7 +573,7 @@ static int

[PATCH v2 1/2] Introduce "precious" file concept

2018-11-26 Thread Nguyễn Thái Ngọc Duy
les alone and unpack-trees.c (i.e. merges and branch switches) will not overwrite ignored-but-precious files. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-clean.txt | 3 ++- Documentation/gitattributes.txt | 13 + Documentation/gitignore.txt | 4 attr.c

[PATCH v2 2/2] unpack-trees: support core.allIgnoredFilesArePreciousWhenMerging

2018-11-26 Thread Nguyễn Thái Ngọc Duy
Ignored files can be marked precious to prevent being overwritten during a merge (or even a branch switch). If you really want to make sure no ignored files are overwritten, this config variable is for you. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config/core.txt | 6

[PATCH v2 0/2] Precios files round two

2018-11-26 Thread Nguyễn Thái Ngọc Duy
goes Ævar and Per are pursuing. It adds an opt-in config that turns all ignored files precious, but only for unpack-trees operations. Nguyễn Thái Ngọc Duy (2): Introduce "precious" file concept unpack-trees: support core.allIgnoredFilesArePreciousWhenMerging Documentation/config/c

[PATCH] files-backend.c: fix build error on Solaris

2018-11-24 Thread Nguyễn Thái Ngọc Duy
This function files_reflog_path returns void, which usually means "return;" not returning "void value" from another function. Reported-by: Ævar Arnfjörð Bjarmason Signed-off-by: Nguyễn Thái Ngọc Duy --- refs/files-backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 del

[PATCH] clone: fix colliding file detection on APFS

2018-11-20 Thread Nguyễn Thái Ngọc Duy
ones Signed-off-by: Nguyễn Thái Ngọc Duy --- So I'm going with match_stat_data(). But I don't know, perhaps just ignoring inode (like Carlo's original patch) is safer/better? Tested on case-insensitive JFS on Linux. But I don't think it really matters because I'm not even sure if I could push

[PATCH 2/5] tree-walk.c: make tree_entry_interesting() take an index

2018-11-18 Thread Nguyễn Thái Ngọc Duy
evs) get_revision_internal get_revision_1 try_to_simplify_commit rev_compare_tree diff_tree_oid(..., >pruning) ll_diff_tree_oid diff_tree_paths ll_diff_tree skip_uninteresting Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 3 ++- builtin/merge-tree.c | 2 +- list-obj

[PATCH 3/5] pathspec.h: clean up "extern" in function declarations

2018-11-18 Thread Nguyễn Thái Ngọc Duy
"extern" on functions is not required and the trend has been removing it from header files. Signed-off-by: Nguyễn Thái Ngọc Duy --- pathspec.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pathspec.h b/pathspec.h index a6525a6551..

[PATCH 5/5] tree-walk: support :(attr) matching

2018-11-18 Thread Nguyễn Thái Ngọc Duy
om _worktree_ (or falling back to the index), not from .gitattributes files on that tree. This by itself is not necessarily wrong, but the user just have to be aware of this. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/glossary-content.txt | 2 + t/t6135-pathspec-with-attrs.sh | 58 ++

[PATCH 4/5] dir.c: move, rename and export match_attrs()

2018-11-18 Thread Nguyễn Thái Ngọc Duy
The function will be reused for matching attributes in pathspec when walking trees (currently it's used for matching pathspec when walking a list). pathspec.c would be a more neutral place for this. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 41

[PATCH 0/5] Make :(attr) pathspec work with "git log"

2018-11-18 Thread Nguyễn Thái Ngọc Duy
rocedure because we don't want to stick the_index (or the_repository) here and there. Nguyễn Thái Ngọc Duy (5): tree.c: make read_tree*() take 'struct repository *' tree-walk.c: make tree_entry_interesting() take an index pathspec.h: clean up "extern" in function declarations di

[PATCH 1/5] tree.c: make read_tree*() take 'struct repository *'

2018-11-18 Thread Nguyễn Thái Ngọc Duy
These functions call tree_entry_interesting() which will soon require a 'struct index_state *' to be passed in. Instead of just changing the function signature to take an index, update to take a repo instead because these functions do need object database access. Signed-off-by: Nguyễn Thái Ngọc

[PATCH] grep: use grep_opt->repo instead of explict repo argument

2018-11-18 Thread Nguyễn Thái Ngọc Duy
-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 41 - 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index 56e4a11052..bdc49cd34e 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -408,18 +408,20 @@ static void

[PATCH] doc: move extensions.worktreeConfig to the right place

2018-11-14 Thread Nguyễn Thái Ngọc Duy
visible to developers who read plain .txt files. Let's include it in gitrepository-layout.5 for more visibility. Some minor asciidoc fixes are required in repository-version.txt to make this happen. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config.txt | 7

[PATCH v2] checkout: print something when checking out paths

2018-11-13 Thread Nguyễn Thái Ngọc Duy
Print something so that if we got the user intention wrong, they won't waste too much time to find that out. For the remaining cases of checkout we now print either - "Checked out ... paths out of the index" - "Checked out ... paths out of " Since the purpose of printing this

[PATCH v2 1/1] checkout: disambiguate dwim tracking branches and local files

2018-11-13 Thread Nguyễn Thái Ngọc Duy
used by scripts. [1] 70c9ac2f19 (DWIM "git checkout frotz" to "git checkout -b frotz origin/frotz" - 2009-10-18) [2] https://public-inbox.org/git/CACsJy8B2TVr1g+k+eSQ=pbeo3wn4_ltglo9gpur8x7z9gof...@mail.gmail.com/ [3] https://news.ycombinator.com/item?id=18230655 [4] a047faf

[PATCH v2 0/1] disambiguate dwim tracking branches and local files

2018-11-13 Thread Nguyễn Thái Ngọc Duy
ey cannot be overriden by user aliases. Nguyễn Thái Ngọc Duy (1): checkout: disambiguate dwim tracking branches and local files Documentation/git-checkout.txt | 4 builtin/checkout.c | 18 +- t/t2024-checkout-dwim.sh | 31

[RFC PATCH] Introduce "precious" file concept

2018-11-11 Thread Nguyễn Thái Ngọc Duy
to record all changes to precious files instead of just "git add -p" changes, for example. So these files are in a sense more precious than other tracked files. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-clean.txt | 3 ++- Documentation/gi

[PATCH] Fix broken command-list.h generation with core.autocrlf

2018-11-10 Thread Nguyễn Thái Ngọc Duy
for this script. Update the attribute file to force LF on all *.txt files to be on the safe side. For more details, please see 00ddc9d13c (Fix build with core.autocrlf=true - 2017-05-09) Signed-off-by: Nguyễn Thái Ngọc Duy --- Some tests must have broken out of the test repo and set core.autocrlf on my

[PATCH/RFC] checkout: print something when checking out paths

2018-11-10 Thread Nguyễn Thái Ngọc Duy
is many tests check empty stderr to see that no error is raised and I'm too lazy to fix all the test cases). [1] Knowing the number of paths updated could also be useful even in normal case. Signed-off-by: Nguyễn Thái Ngọc Duy --- This is related to another patch in https://

[PATCH] checkout: disambiguate dwim tracking branches and local files

2018-11-10 Thread Nguyễn Thái Ngọc Duy
. [1] 70c9ac2f19 (DWIM "git checkout frotz" to "git checkout -b frotz origin/frotz" - 2009-10-18) [2] https://public-inbox.org/git/CACsJy8B2TVr1g+k+eSQ=pbeo3wn4_ltglo9gpur8x7z9gof...@mail.gmail.com/ [3] https://news.ycombinator.com/item?id=18230655 Signed-off-by: Nguyễn Thái N

[PATCH v2 02/22] wt-status.c: remove implicit dependency the_repository

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ref-filter.c | 2 +- wt-status.c | 18 ++ wt-status.h | 4 +++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 0c45ed9d94..c4eaf30313 100644 --- a/ref-filter.c +++ b/ref-filter.c

[PATCH v2 03/22] list-objects-filter.c: remove implicit dependency on the_index

2018-11-09 Thread Nguyễn Thái Ngọc Duy
While at there, since we have access to struct repository now, eliminate the only the_repository reference in this file. Signed-off-by: Nguyễn Thái Ngọc Duy --- list-objects-filter.c | 10 +++--- list-objects-filter.h | 2 ++ list-objects.c| 9 ++--- 3 files changed, 15

[PATCH v2 10/22] blame.c: remove implicit dependency the_repository

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- blame.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/blame.c b/blame.c index d84c937780..43861437f7 100644 --- a/blame.c +++ b/blame.c @@ -116,35 +116,38 @@ static void

[PATCH v2 18/22] notes-cache.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- combine-diff.c | 2 +- diff.c | 12 ++-- diff.h | 2 +- diffcore-pickaxe.c | 4 ++-- grep.c | 2 +- notes-cache.c | 12 +++- notes-cache.h | 6 -- userdiff.c | 5

[PATCH v2 16/22] diff-lib.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 3 ++- builtin/merge-ours.c | 2 +- diff-lib.c | 7 --- diff.h | 3 ++- sequencer.c | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c

[PATCH v2 07/22] transport.c: remove implicit dependency on the_index

2018-11-09 Thread Nguyễn Thái Ngọc Duy
note, there's still another hidden dependency related to this: even though we pass a repo to transport_push() we still use is_bare_repository() which pretty much assumes the_repository (and some other global state). Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/push.c | 3 ++- transport.c

[PATCH v2 13/22] bundle.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/bundle.c | 7 --- bundle.c | 26 ++ bundle.h | 9 + transport.c | 2 +- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/builtin/bundle.c b/builtin/bundle.c index

[PATCH v2 11/22] bisect.c: remove the_repository reference

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- bisect.c | 48 +++- bisect.h | 5 - builtin/bisect--helper.c | 2 +- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/bisect.c b/bisect.c index 487675c672..4c1b80bff6

[PATCH v2 01/22] wt-status.c: remove implicit dependency on the_index

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 2 +- builtin/pull.c | 3 +- builtin/rebase.c | 7 +++-- sequencer.c | 8 ++--- wt-status.c | 76 +++- wt-status.h | 17 +++ 6 files changed, 66 insertions(+), 47

[PATCH v2 20/22] pack-*.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-objects.c | 2 +- pack-bitmap-write.c| 6 +++--- pack-bitmap.c | 13 +++-- pack-bitmap.h | 3 ++- pack-objects.c | 6 -- pack-objects.h | 5 - 6 files changed, 21 insertions(+), 14

[PATCH v2 19/22] pack-check.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/fsck.c | 3 ++- pack-check.c | 9 + pack.h | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/builtin/fsck.c b/builtin/fsck.c index 06eb421720..8ea2823864 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c

[PATCH v2 09/22] sequencer.c: remove implicit dependency on the_repository

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Note that the_hash_algo stays, even if we can easily replace it with repo->hash_algo. My reason is I still believe tying hash_algo to a struct repository is a wrong move. But if I'm wrong, we can always go for another round of conversion. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/reb

[PATCH v2 05/22] notes-merge.c: remove implicit dependency on the_index

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/notes.c | 2 +- notes-merge.c | 12 +++- notes-merge.h | 5 - 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index c05cd004ab..15a6c78855 100644 --- a/builtin/notes.c +++ b

[PATCH v2 21/22] rerere.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/am.c | 2 +- builtin/rebase--interactive.c | 2 +- builtin/rebase.c | 4 ++-- builtin/rerere.c | 10 ++ rerere.c | 26 +- rerere.h

[PATCH v2 12/22] branch.c: remove the_repository reference

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- branch.c | 21 +++-- branch.h | 8 ++-- builtin/am.c | 2 +- builtin/branch.c | 6 -- builtin/checkout.c | 5 +++-- builtin/reset.c| 2 +- builtin/revert.c | 2 +- 7 files changed, 27

[PATCH v2 04/22] list-objects.c: reduce the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- list-objects.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/list-objects.c b/list-objects.c index 0cfd646026..cf7f25bed3 100644 --- a/list-objects.c +++ b/list-objects.c @@ -123,7 +123,7 @@ static void process_tree_contents

[PATCH v2 00/22] Kill the_index part 5

2018-11-09 Thread Nguyễn Thái Ngọc Duy
cts. :-D [2] https://public-inbox.org/git/20181019145237.16079-1-pclo...@gmail.com/ Nguyễn Thái Ngọc Duy (22): wt-status.c: remove implicit dependency on the_index wt-status.c: remove implicit dependency the_repository list-objects-filter.c: remove implicit dependency on the_index l

[PATCH v2 06/22] notes-merge.c: remove implicit dependency the_repository

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- notes-merge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notes-merge.c b/notes-merge.c index 0c22f09b28..72688d301b 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -558,7 +558,7 @@ int notes_merge(struct notes_merge_options

[PATCH v2 15/22] delta-islands.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-objects.c | 4 ++-- delta-islands.c| 24 ++-- delta-islands.h| 9 ++--- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index c99ee79c31

[PATCH v2 17/22] line-log.c: remove the_repository reference

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- line-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/line-log.c b/line-log.c index d1d429d738..24e21731c4 100644 --- a/line-log.c +++ b/line-log.c @@ -479,7 +479,7 @@ static struct commit *check_single_commit(struct rev_info

[PATCH v2 14/22] cache-tree.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
ject database to lookup_tree() but that ship has sailed. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/read-tree.c | 4 +++- builtin/rebase.c| 2 +- builtin/reset.c | 2 +- cache-tree.c| 26 +++--- cache-tree.h| 4 ++-- read-cache.c| 2 +-

[PATCH v2 08/22] sequencer.c: remove implicit dependency on the_index

2018-11-09 Thread Nguyễn Thái Ngọc Duy
in this file, but total clean up will be done later. It's not the main focus of this patch. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 3 +- builtin/merge.c | 2 +- builtin/rebase--interactive.c | 4 +- builtin/revert.c | 4

[PATCH v2 22/22] rebase-interactive.c: remove the_repository references

2018-11-09 Thread Nguyễn Thái Ngọc Duy
While at there add a forward declaration for struct strbuf. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/rebase--interactive.c | 2 +- rebase-interactive.c | 6 +++--- rebase-interactive.h | 5 - 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/builtin

[PATCH v3 08/16] reflog: mark strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
One string "nothing to delete?" is rephrased to be more helpful. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/reflog.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/builtin/reflog.c b/builtin/reflog.c index b5941c1ff3..

[PATCH 02/22] wt-status.c: remove implicit dependency the_repository

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ref-filter.c | 2 +- wt-status.c | 18 ++ wt-status.h | 4 +++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 0c45ed9d94..c4eaf30313 100644 --- a/ref-filter.c +++ b/ref-filter.c

[PATCH v2] format-patch: respect --stat in cover letter's diffstat

2018-11-09 Thread Nguyễn Thái Ngọc Duy
to do here is drop the assignment. Reported-by: Laszlo Ersek Helped-by: Leif Lindholm Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/log.c | 2 -- t/t4052-stat-output.sh | 48 +- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git

[PATCH 03/22] list-objects-filter.c: remove implicit dependency on the_index

2018-11-09 Thread Nguyễn Thái Ngọc Duy
While at there, since we have access to struct repository now, eliminate the only the_repository reference in this file. Signed-off-by: Nguyễn Thái Ngọc Duy --- list-objects-filter.c | 10 +++--- list-objects-filter.h | 2 ++ list-objects.c| 9 ++--- 3 files changed, 15

[PATCH 00/22] Kill the_index part 5

2018-11-09 Thread Nguyễn Thái Ngọc Duy
git/20181019145237.16079-1-pclo...@gmail.com/ Nguyễn Thái Ngọc Duy (22): wt-status.c: remove implicit dependency on the_index wt-status.c: remove implicit dependency the_repository list-objects-filter.c: remove implicit dependency on the_index list-objects.c: reduce the_repository references notes-merg

[PATCH 01/22] wt-status.c: remove implicit dependency on the_index

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 2 +- builtin/pull.c | 3 +- builtin/rebase.c | 7 +++-- sequencer.c | 8 ++--- wt-status.c | 76 +++- wt-status.h | 17 +++ 6 files changed, 66 insertions(+), 47

[PATCH v3 13/16] parse-options.c: turn some die() to BUG()

2018-11-09 Thread Nguyễn Thái Ngọc Duy
These two strings are clearly not for the user to see. Reduce the violence in one string while at there. Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse-options.c b/parse-options.c index 0bf817193d..3f5f985c1e

[PATCH v3 11/16] repack: mark more strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Two strings are slightly updated to be consistent with the rest: die() starts with lowercase. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/repack.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/builtin/repack.c b/builtin/repack.c index

[PATCH v3 15/16] fsck: reduce word legos to help i18n

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Thái Ngọc Duy --- builtin/fsck.c | 65 +++--- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/builtin/fsck.c b/builtin/fsck.c index 06eb421720..1feb6142f4 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -52,16 +52,24 @@ static int

[PATCH v3 10/16] remote.c: mark messages for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
The two strings are slightly modified to be consistent with the rest: die() and error() start with a lowercase. Signed-off-by: Nguyễn Thái Ngọc Duy --- remote.c | 43 ++- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/remote.c b/remote.c

[PATCH v3 01/16] git.c: mark more strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
One string is slightly updated to keep consistency with the rest: die() should begin with lowercase. Signed-off-by: Nguyễn Thái Ngọc Duy --- git.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/git.c b/git.c index adac132956..5fd30da093

[PATCH v3 12/16] parse-options: replace opterror() with optname()

2018-11-09 Thread Nguyễn Thái Ngọc Duy
if needed. But it has limitations, if the subject part has to change based on the rest of the sentence, that language is screwed. This is also why I try to avoid calling optname() when 'flags' is known in advance. Mark of these strings for translation as well while at there. Signed-off-by: Nguyễn Thá

[PATCH v3 05/16] read-cache.c: turn die("internal error") to BUG()

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/read-cache.c b/read-cache.c index d57958233e..0c37f4885e 100644 --- a/read-cache.c +++ b/read-cache.c @@ -316,7 +316,7 @@ static int ce_match_stat_basic(const struct

[PATCH v3 09/16] remote.c: turn some error() or die() to BUG()

2018-11-09 Thread Nguyễn Thái Ngọc Duy
The first error, "internal error", is clearly a BUG(). The second two are meant to catch calls with invalid parameters and should never happen outside the test suite. Signed-off-by: Nguyễn Thái Ngọc Duy --- remote.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v3 14/16] parse-options.c: mark more strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
One error is updated to start with lowercase to be consistent with the rest. Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options.c | 14 +++--- t/t0040-parse-options.sh | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/parse-options.c b/parse-options.c

[PATCH v3 07/16] read-cache.c: add missing colon separators

2018-11-09 Thread Nguyễn Thái Ngọc Duy
typechange_fmt and added_fmt should have a colon before "needs update". Align the statements to make it easier to read and see. Also drop the unnecessary (). Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --

[PATCH v3 04/16] attr.c: mark more string for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index 60d284796d..3770bc1a11 100644 --- a/attr.c +++ b/attr.c @@ -372,8 +372,8 @@ static struct match_attr *parse_attr_line(const char *line, const char *src

[PATCH v3 06/16] read-cache.c: mark more strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
There are a couple other improvements on these strings as well: - add missing colon (as separator) - quote paths - provide more information on error messages - keep first word in lowercase Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c| 57

[PATCH v3 02/16] alias.c: mark split_cmdline_strerror() strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
This function can be part of translated messages. To make sure we don't have a sentence with mixed languages, mark the strings for translation, but only use translated strings in places we know we will output translated strings. Signed-off-by: Nguyễn Thái Ngọc Duy --- alias.c | 4

[PATCH v3 03/16] archive.c: mark more strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Two messages also print extra information to be more useful Signed-off-by: Nguyễn Thái Ngọc Duy --- archive.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/archive.c b/archive.c index 9d16b7fadf..d8f6e1ce30 100644 --- a/archive.c +++ b/archive.c @@ -385,12 +385,12

[PATCH v3 00/16] Mark more strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
%s %s: %s"), + printable_type(obj), describe_object(obj), message); + return 1; + default: @@ */ if (!obj) { Nguyễn Thái Ngọc Duy (16): git.c: mark more strings for translation alias.c: mark split_cmdline_strerror(

[PATCH v3 16/16] fsck: mark strings for translation

2018-11-09 Thread Nguyễn Thái Ngọc Duy
Two die() are updated to start with lowercase to be consistent with the rest. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/fsck.c | 106 - t/t1410-reflog.sh | 6 +-- t/t1450-fsck.sh| 50 - t/t6050

[PATCH v2] format-patch: respect --stat in cover letter's diffstat

2018-11-07 Thread Nguyễn Thái Ngọc Duy
to do here is drop the assignment. Reported-by: Laszlo Ersek Helped-by: Leif Lindholm Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/log.c | 2 -- t/t4052-stat-output.sh | 48 +- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git

[PATCH/RFC] Support --append-trailer in cherry-pick and revert

2018-11-06 Thread Nguyễn Thái Ngọc Duy
than just "machine generated tags". Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-cherry-pick.txt | 6 + Documentation/git-revert.txt | 6 + builtin/revert.c | 7 ++ sequencer.c | 39

[PATCH v2 13/16] parse-options.c: turn some die() to BUG()

2018-11-05 Thread Nguyễn Thái Ngọc Duy
These two strings are clearly not for the user to see. Reduce the violence in one string while at there. Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse-options.c b/parse-options.c index 0bf817193d..3f5f985c1e

[PATCH v2 16/16] fsck: mark strings for translation

2018-11-05 Thread Nguyễn Thái Ngọc Duy
Two die() are updated to start with lowercase to be consistent with the rest. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/fsck.c | 106 - t/t1410-reflog.sh | 6 +-- t/t1450-fsck.sh| 50 - t/t6050

[PATCH v2 12/16] parse-options: replace opterror() with optname()

2018-11-05 Thread Nguyễn Thái Ngọc Duy
in advance. Mark of these strings for translation as well while at there. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/merge.c | 2 +- builtin/revert.c| 3 ++- parse-options-cb.c | 7 --- parse-options.c | 46 + parse-options.

[PATCH v2 15/16] fsck: reduce word legos to help i18n

2018-11-05 Thread Nguyễn Thái Ngọc Duy
Thái Ngọc Duy --- builtin/fsck.c | 62 ++ 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/builtin/fsck.c b/builtin/fsck.c index 06eb421720..504f47d7a4 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -52,16 +52,24 @@ static int

[PATCH v2 14/16] parse-options.c: mark more strings for translation

2018-11-05 Thread Nguyễn Thái Ngọc Duy
One error is updated to start with lowercase to be consistent with the rest. Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options.c | 14 +++--- t/t0040-parse-options.sh | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/parse-options.c b/parse-options.c

[PATCH v2 01/16] git.c: mark more strings for translation

2018-11-05 Thread Nguyễn Thái Ngọc Duy
One string is slightly updated to keep consistency with the rest: die() should with lowercase. Signed-off-by: Nguyễn Thái Ngọc Duy --- git.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/git.c b/git.c index adac132956..5fd30da093 100644

[PATCH v2 07/16] read-cache.c: add missing colon separators

2018-11-05 Thread Nguyễn Thái Ngọc Duy
typechange_fmt and added_fmt should have a colon before "needs update". Align the statements to make it easier to read and see. Also drop the unnecessary (). Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --

[PATCH v2 08/16] reflog: mark strings for translation

2018-11-05 Thread Nguyễn Thái Ngọc Duy
One string "nothing to delete?" is rephrased to be more helpful. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/reflog.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/builtin/reflog.c b/builtin/reflog.c index b5941c1ff3..

  1   2   3   4   5   6   7   8   9   10   >