Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sha1-name.c b/sha1-name.c
index 6b53ea2eeb..64a50d1291 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -12,6 +12,7 @@
#include "packfile.h"
#include "
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 4 +++-
setup.c | 7 ---
sha1-name.c | 6 --
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/cache.h b/cache.h
index 942d9912a2..da7035c261 100644
--- a/cache.h
+++ b/cache.h
@@ -1361,7 +1361,9 @@ extern int
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 3 ++-
sha1-name.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/cache.h b/cache.h
index 9ff5af0bef..942d9912a2 100644
--- a/cache.h
+++ b/cache.h
@@ -1354,7 +1354,8 @@ enum get_oid_result
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 18 --
sha1-name.c | 35 ---
2 files changed, 32 insertions(+), 21 deletions(-)
diff --git a/cache.h b/cache.h
index da7035c261..7ce8c566fc 100644
--- a/cache.h
+++ b/cache.h
@@ -1355,12
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 3 ++-
sha1-name.c | 18 +++---
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/cache.h b/cache.h
index 7ce8c566fc..24fbff94f7 100644
--- a/cache.h
+++ b/cache.h
@@ -1360,6 +1360,7 @@ int repo_get_oid_committish
There is a cyclic dependency between one of these functions so they
cannot be converted one by one, so all related functions are converted
at once.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 7 +--
sha1-name.c | 59 -
2 files
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 17 ++---
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index cdcf84b826..2643b75b54 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -436,7 +436,8 @@ static void sort_ambiguous_oid_array
Signed-off-by: Nguyễn Thái Ngọc Duy
---
dir.c | 8
dir.h | 4 +++-
sha1-name.c | 7 ---
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/dir.c b/dir.c
index b2cabadf25..e6d97343f4 100644
--- a/dir.c
+++ b/dir.c
@@ -2315,6 +2315,14 @@ int file_exists(const
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 19 ++-
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 5741a9f821..d9050776dd 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -1189,15 +1189,21 @@ static enum get_oid_result
"remove" is not entirely correct. But at least the function is aware
that if the given repo is not the_repository, then $CWD and
is_inside_work_tree() means nothing.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
di
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 12 +---
refs.h | 1 +
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/refs.c b/refs.c
index 1f5864aa36..bd0fec5776 100644
--- a/refs.c
+++ b/refs.c
@@ -555,14 +555,20 @@ static char *substitute_branch_name(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
---
commit.c | 5 +++--
commit.h | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/commit.c b/commit.c
index a5333c7ac6..f0a5506f04 100644
--- a/commit.c
+++ b/commit.c
@@ -340,7 +340,8 @@ void free_commit_buffer(struct parsed_object_pool
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/show-branch.c | 6 --
refs.c| 7 ---
refs.h| 3 ++-
sha1-name.c | 3 ++-
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 49c62d5254..fb80306f1a 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -15,7 +15,7 @@
#include "midx.h"
#include "
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 25 -
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 1cda854f02..d4c135aea8 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -773,8 +773,8 @@ static inline int push_mark
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index fb80306f1a..1cda854f02 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -1097,7 +1097,9 @@ static int peel_onion(const char *name, int len
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 17 -
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 7d9512ac44..49c62d5254 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -1390,7 +1390,8 @@ static int interpret_empty_at(const
Signed-off-by: Nguyễn Thái Ngọc Duy
---
packfile.c | 14 +++---
packfile.h | 3 ++-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/packfile.c b/packfile.c
index 16bcb75262..2ad4fab2f8 100644
--- a/packfile.c
+++ b/packfile.c
@@ -893,25 +893,25 @@ static void
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index 142888a40a..b869f32d8b 100644
--- a/refs.c
+++ b/refs.c
@@ -241,9 +241,14 @@ int read_ref(const char *refname, struct object_id *oid)
return
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 11 +--
refs.h | 2 ++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index b869f32d8b..3dde824aab 100644
--- a/refs.c
+++ b/refs.c
@@ -1169,7 +1169,8 @@ int update_ref(const char *msg, const char *refname
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c| 10 ++
refs.h| 2 +-
upload-pack.c | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 44df049796..1f5864aa36 100644
--- a/refs.c
+++ b/refs.c
@@ -558,12 +558,13 @@ static char
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 95 +
1 file changed, 59 insertions(+), 36 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 9b57787b76..a75992eb54 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -17,13 +17,14
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 17 ++---
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 2643b75b54..af8bf5b351 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -771,7 +771,7 @@ static inline int push_mark(const char
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 6 --
sha1-name.c | 15 +--
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/cache.h b/cache.h
index aa52850d84..524a44110a 100644
--- a/cache.h
+++ b/cache.h
@@ -1019,8 +1019,10 @@ extern void
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index af8bf5b351..7d9512ac44 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -1412,9 +1412,9 @@ static int reinterpret(const char *name
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 3 ++-
sha1-name.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/cache.h b/cache.h
index 524a44110a..92973e7ae0 100644
--- a/cache.h
+++ b/cache.h
@@ -1366,7 +1366,8 @@ extern enum get_oid_result
Signed-off-by: Nguyễn Thái Ngọc Duy
---
cache.h | 8 ++--
refs.c | 9 +
sha1-name.c | 8 ++--
3 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/cache.h b/cache.h
index 27fe635f62..aa52850d84 100644
--- a/cache.h
+++ b/cache.h
@@ -1442,8 +1442,12 @@ extern
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 21 +++--
refs.h | 1 +
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index bd0fec5776..edea001446 100644
--- a/refs.c
+++ b/refs.c
@@ -603,9 +603,11 @@ int expand_ref(struct repository *repo
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 7558ce51a3..b9381aaba6 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -514,6 +514,7 @@ struct min_abbrev_data {
unsigned int
fter 28/31 are technically not needed, but
since I have converted most of sha1-name.c, might as well convert the
rest.
There is a new function get_oidf() from another series on 'pu', which
can't be converted right now of course. But it could be fixed easily
later. It also causes a co
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1-name.c | 15 ---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/sha1-name.c b/sha1-name.c
index 15a1107998..7558ce51a3 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -383,10 +383,11 @@ static int collect_ambiguous(const
lone.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/git-clean.txt | 3 ++-
Documentation/gitattributes.txt | 11 +++
Documentation/gitignore.txt | 4
attr.c | 12
attr.h | 2 ++
builtin/clean.c
Compared to the last round [1], the "precious" attribute is now only
used by "git clean". "git merge" and "git checkout" will not abort when
they are about to overwrite precious files.
[1] https://public-inbox.org/git/20181126193804.30741-1-pcl
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 59 +-
1 file changed, 25 insertions(+), 34 deletions(-)
diff --git a/diff.c b/diff.c
index e51f6b3005..35bac115cc 100644
--- a/diff.c
+++ b/diff.c
@@ -4617,8
For --rename-empty, see 90d43b0768 (teach diffcore-rename to
optionally ignore empty content - 2012-03-22) for more information.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
Documentation/diff-options.txt | 3 +++
diff.c | 13 ++---
2
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 25 +
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/diff.c b/diff.c
index d423a06b41..b9c267a199 100644
--- a/diff.c
+++ b/diff.c
@@ -4960,6 +4960,18 @@ static enum
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/diff.c b/diff.c
index b9c267a199..33492e754f 100644
--- a/diff.c
+++ b/diff.c
@@ -5105,6 +5105,11 @@ static void prep_parse_options(struct
--no-find-copies-harder is also added on purpose (because I don't see
why we should not have the --no- version for this)
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/diff.c b/diff.c
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 27 ---
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/diff.c b/diff.c
index 33492e754f..a63ee4a44d 100644
--- a/diff.c
+++ b/diff.c
@@ -5109,6 +5109,21 @@ static void
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 35 +++
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/diff.c b/diff.c
index d2139082b7..2c904e0526 100644
--- a/diff.c
+++ b/diff.c
@@ -4909,6 +4909,22 @@ static int
This also validates that the user specifies a single character in
--output-indicator-*, not a string.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
Documentation/diff-options.txt | 10 +
diff.c | 71 +-
2 files
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index 2c904e0526..e51f6b3005 100644
--- a/diff.c
+++ b/diff.c
@@ -5060,6 +5060,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 118 +
1 file changed, 52 insertions(+), 66 deletions(-)
diff --git a/diff.c b/diff.c
index 9c8f5336bc..1feb13deb3 100644
--- a/diff.c
+++ b/diff.c
@@ -104,11
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 25 +++--
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/diff.c b/diff.c
index 1feb13deb3..b24f6825a1 100644
--- a/diff.c
+++ b/diff.c
@@ -4841,6 +4841,21 @@ static int
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 62 ++
1 file changed, 36 insertions(+), 26 deletions(-)
diff --git a/diff.c b/diff.c
index 8df396cb9a..d2139082b7 100644
--- a/diff.c
+++ b/diff.c
@@ -4841,6 +4841,30 @@ static int
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 99047fb5fe..9c8f5336bc 100644
--- a/diff.c
+++ b/diff.c
@@ -4906,6 +4906,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index 0276f25200..b9811aefef 100644
--- a/diff.c
+++ b/diff.c
@@ -4921,6 +4921,10 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
Documentation/diff-options.txt | 7 ++
diff.c | 39 +-
2 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/Documentation/diff-options.txt b
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index b9811aefef..7ea308814f 100644
--- a/diff.c
+++ b/diff.c
@@ -4949,6 +4949,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 5e16082091..0276f25200 100644
--- a/diff.c
+++ b/diff.c
@@ -4942,6 +4942,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 7ea308814f..99047fb5fe 100644
--- a/diff.c
+++ b/diff.c
@@ -4952,6 +4952,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 1cdbe8e688..5e16082091 100644
--- a/diff.c
+++ b/diff.c
@@ -4939,6 +4939,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/diff.c b/diff.c
index 12e333c67f..419b6ac4ae 100644
--- a/diff.c
+++ b/diff.c
@@ -4905,6 +4905,12 @@ static void prep_parse_options
v3 is the same as v2 except I will not delete the patches while it's
still sending, grr...
Nguyễn Thái Ngọc Duy (21):
diff-parseopt: convert --patch-with-raw
diff-parseopt: convert --numstat and --shortstat
diff-parseopt: convert --dirstat and friends
diff-parseopt: convert --check
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index 4bc9df7362..12e333c67f 100644
--- a/diff.c
+++ b/diff.c
@@ -4901,6 +4901,10 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 5e16082091..0276f25200 100644
--- a/diff.c
+++ b/diff.c
@@ -4942,6 +4942,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
Documentation/diff-options.txt | 7 ++
diff.c | 39 +-
2 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/Documentation/diff-options.txt b
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 1cdbe8e688..5e16082091 100644
--- a/diff.c
+++ b/diff.c
@@ -4939,6 +4939,9 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/diff.c b/diff.c
index 12e333c67f..419b6ac4ae 100644
--- a/diff.c
+++ b/diff.c
@@ -4905,6 +4905,12 @@ static void prep_parse_options
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index 0276f25200..b9811aefef 100644
--- a/diff.c
+++ b/diff.c
@@ -4921,6 +4921,10 @@ static void prep_parse_options(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
diff.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index 4bc9df7362..12e333c67f 100644
--- a/diff.c
+++ b/diff.c
@@ -4901,6 +4901,10 @@ static void prep_parse_options(struct
v2 changes the subject line to help clarify in "git log --oneline"
Nguyễn Thái Ngọc Duy (21):
diff-parseopt: convert --patch-with-raw
diff-parseopt: convert --numstat and --shortstat
diff-parseopt: convert --dirstat and friends
diff-parseopt: convert --check
diff-parseop
This adds value completion for a couple more paramters. To make it
easier to maintain these hard coded lists, add a comment at the original
list/code to remind people to update git-completion.bash too.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
apply.c| 4
thread to hide away all this
even if it becomes significant.
For writing, I believe the extra cycles spent in writing is still
nothing compared to hashing code and this should still result in faster
index update (numbers needed). On webkit.git, updating one entry on v5
is 30% faster than v4.
Signed-
with a segfault. This should not happen anymore, but it's still wrong to
dereference a potential NULL pointer, especially when we do check for
NULL pointer in the next code.
Reported-by: Luke Diamand
Signed-off-by: Nguyễn Thái Ngọc Duy
---
v2 added a new test
read-cache.c | 5 +
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Jiang Xin's typo patch [1] made me quickly go through all multi-line
strings. This is the only bad string I found.
[1]
https://public-inbox.org/git/canyiybgf6oj0k3-k+s0dso-bzz2excvcoyxojtqsbbmhetg...@mail.gmail.com/
imap-send.c | 2 +-
1 file ch
with a segfault. This should not happen anymore, but it's still wrong to
dereference a potential NULL pointer, especially when we do check for
NULL pointer in the next code.
Reported-by: Luke Diamand
Signed-off-by: Nguyễn Thái Ngọc Duy
---
I considered adding a test, but since the problem is
Signed-off-by: Nguyễn Thái Ngọc Duy
---
t/t2060-switch.sh | 87 +++
1 file changed, 87 insertions(+)
create mode 100755 t/t2060-switch.sh
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
new file mode 100755
index 00..1e1e834c1b
--- /dev
witch' do automatic detach or dwim
again. But that will be opt-in after the user knows what is what. For
now give a short option if you want to use it often.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/git-checkout.txt | 37 --
builtin/checkout.c
t.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/checkout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index d6c968f5f3..a5284391a9 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1381,7 +1381,
-B and --detach. Users of big repos are encouraged to
move to switch.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/config/checkout.txt | 8 --
builtin/checkout.c| 127 +++---
t/t1090-sparse-checkout-scope.sh | 14
3 files changed, 9 inser
commands...
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/git-branch.txt | 12 +++---
Documentation/git-check-ref-format.txt | 3 +-
Documentation/git-format-patch.txt | 2 +-
Documentation/git-merge-base.txt | 2 +-
Documentation/git-rebase.txt | 2 +
Completion support for --guess could be made better. If no --detach is
given, we should only provide a list of refs/heads/* and dwim ones,
not the entire ref space. But I still can't penetrate that
__git_refs() function yet.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
contrib/completio
of (until you know better).
To keep switch a bit more friendly to new users, we only allow
entering detached HEAD mode when --detach is given. "git
switch" must take a branch (unless you create a new branch,
then of course switch can take any commit-ish)
Signed-off-by: Nguyễn Thái Ng
to either
- really switch a branch
- (explicitly) detach from the current branch
- create a new branch
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/checkout.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 4822d5c5d7..86e524f7c1
The shortcut of these options do not make much sense when used with
switch. 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 | 32
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") of
course do accept pathspec as before.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
bui
This option is ancient. Nowadays reflog is enabled by default and
automatically created for new branches. Keep it in git-checkout only.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/checkout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/checkout.c b/builtin
n page.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
.gitignore| 1 +
Documentation/config/advice.txt | 13 +-
Documentation/config/branch.txt | 4 +-
Documentation/config/checkout.txt | 9 +-
Documentation/config/diff.txt | 3 +-
Documentation/git-checkout.txt
separate.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/checkout.c | 82 +-
parse-options-cb.c | 17 ++
parse-options.h| 3 +-
3 files changed, 78 insertions(+), 24 deletions(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index
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 ce7d38b8b7..bc7fbdb8d2 100644
--- a/Documentation/g
I added this option in git-checkout and git-merge in c1d7036b6b
(checkout,merge: disallow overwriting ignored files with
--no-overwrite-ignore - 2011-11-27) but did not remember to update
documentation. This completes that commit.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/git
This is in preparation for the new command restore, 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 insertions(+),
The old name does not really say that this is about 'checkout -b'. See
49d833dc07 (Revert "checkout branch: prime cache-tree fully" -
2009-05-12) for more information
Signed-off-by: Nguyễn Thái Ngọc Duy
---
t/{t2014-switch.sh => t2014-checkout-switch.sh} | 0
1 file chan
and commit them, and you can discard any commits you make in
this
+- state without impacting any branches by performing another checkout.
++ state without impacting any branches by switching back to a branch.
+
If you want to create a new branch to retain commits you create, you
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
"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 | 115 +++
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 27 ---
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/diff.c b/diff.c
index 33492e754f..a63ee4a44d 100644
--- a/diff.c
+++ b/diff.c
@@ -5109,6 +5109,21 @@ static void prep_parse_options(struct diff_options
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/diff.c b/diff.c
index b9c267a199..33492e754f 100644
--- a/diff.c
+++ b/diff.c
@@ -5105,6 +5105,11 @@ static void prep_parse_options(struct diff_options
*options
--no-find-copies-harder is also added on purpose (because I don't see
why we should not have the --no- version for this)
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/diff.c b/diff.c
index 35bac115cc..abb1566f95 1
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 118 +
1 file changed, 52 insertions(+), 66 deletions(-)
diff --git a/diff.c b/diff.c
index 9c8f5336bc..1feb13deb3 100644
--- a/diff.c
+++ b/diff.c
@@ -104,11 +104,6 @@ static const char
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 62 ++
1 file changed, 36 insertions(+), 26 deletions(-)
diff --git a/diff.c b/diff.c
index 8df396cb9a..d2139082b7 100644
--- a/diff.c
+++ b/diff.c
@@ -4841,6 +4841,30 @@ static int
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 25 +++--
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/diff.c b/diff.c
index 1feb13deb3..b24f6825a1 100644
--- a/diff.c
+++ b/diff.c
@@ -4841,6 +4841,21 @@ static int parse_objfind_opt(struct diff_options *opt
This also validates that the user specifies a single character in
--output-indicator-*, not a string.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/diff-options.txt | 10 +
diff.c | 71 +-
2 files changed, 63 insertions(+), 18
For --rename-empty, see 90d43b0768 (teach diffcore-rename to
optionally ignore empty content - 2012-03-22) for more information.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/diff-options.txt | 3 +++
diff.c | 13 ++---
2 files changed, 9 insertions
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 25 +
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/diff.c b/diff.c
index d423a06b41..b9c267a199 100644
--- a/diff.c
+++ b/diff.c
@@ -4960,6 +4960,18 @@ static enum parse_opt_result diff_opt_output(struct
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 59 +-
1 file changed, 25 insertions(+), 34 deletions(-)
diff --git a/diff.c b/diff.c
index e51f6b3005..35bac115cc 100644
--- a/diff.c
+++ b/diff.c
@@ -4617,8 +4617,6 @@ static int opt_arg
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index 2c904e0526..e51f6b3005 100644
--- a/diff.c
+++ b/diff.c
@@ -5060,6 +5060,9 @@ static void prep_parse_options(struct diff_options
*options
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 35 +++
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/diff.c b/diff.c
index d2139082b7..2c904e0526 100644
--- a/diff.c
+++ b/diff.c
@@ -4909,6 +4909,22 @@ static int diff_opt_dirstat(const struct
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diff.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 7ea308814f..99047fb5fe 100644
--- a/diff.c
+++ b/diff.c
@@ -4952,6 +4952,9 @@ static void prep_parse_options(struct diff_options
*options
501 - 600 of 5892 matches
Mail list logo