t5561 failing after make PROFILE=GEN

2015-09-22 Thread Stephan Beyer
Hi, I noticed that t5561 fails on my machine when compiling with "make PROFILE=GEN". Luckily, the reason seems to be the test only, not the tool it is testing. I tracked it down that far that log_div() (defined in t/t5561-http-backend.sh but used in t/t556x_common) appends the given text to the

[PATCH] t5561: get rid of racy appending to logfile

2015-09-24 Thread Stephan Beyer
. This commit removes log_div() and its calls. The additional information is kept in the test (for readability reasons) but filtered out before comparing it to the actual logfile. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Okay Peff, I added the information to the commit message (in

[PATCH] t5561: get rid of racy appending to logfile

2015-09-24 Thread Stephan Beyer
. This commit removes log_div() and its calls. The additional information is kept in the test (for readability reasons) but filtered out before comparing it to the actual logfile. Signed-off-by: Stephan Beyer <s-be...@gmx.net> Acked-by: Jeff King <p...@peff.net> --- SubmittingPatches sa

[PATCH] t/perf: make runner work even if Git is not installed

2015-09-24 Thread Stephan Beyer
'../../perl/blib/lib'; instead of the flexible environment-based variant use lib (split(/:/, $ENV{GITPERLLIB})); which is used in tests written in Perl. The hard-coded variant is used because the whole performance test framework does it that way (and GITPERLLIB is not set there). Signed-off-by: Stephan

Re: t5561 failing after make PROFILE=GEN

2015-09-23 Thread Stephan Beyer
Hi, On 09/24/2015 01:24 AM, Jeff King wrote: >> I noticed that t5561 fails on my machine when compiling with >> "make PROFILE=GEN". Luckily, the reason seems to be the test only, >> not the tool it is testing. >> >> I tracked it down that far that log_div() (defined in >> t/t5561-http-backend.sh

[PATCH] t5561: get rid of racy appending to logfile

2015-09-23 Thread Stephan Beyer
rid of this behavior, the logfile is not touched at all. This commit removes log_div() and its calls. The readability-improving information is kept in the test but filtered out before comparing it to the actual logfile. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- t/t5560-http-b

Re: [PATCH 01/16] bisect: write about `bisect next` in documentation

2016-02-27 Thread Stephan Beyer
Hi, On 02/27/2016 07:03 PM, Junio C Hamano wrote: > Stephan Beyer <s-be...@gmx.net> writes: > >> This command is also handy when you accidentally checked out another >> commit during a bisection. It computes the commit for the bisection >> and checks it

Re: [PATCH 02/16] bisect: add test for the bisect algorithm

2016-02-26 Thread Stephan Beyer
Hi Christian, On 02/26/2016 07:53 AM, Christian Couder wrote: >> +test_expect_success 'bisect algorithm works in linear history with an odd >> number of commits' ' >> + git bisect start A7 && >> + git bisect next && >> + test "$(git rev-parse HEAD)" = "$(git rev-parse A3)" \ >>

Re: [PATCH 14/16] bisect: use a modified breadth-first search to find relevant weights

2016-02-26 Thread Stephan Beyer
Hi, On 02/26/2016 04:09 AM, Junio C Hamano wrote: > Interesting. So you walk from the bottom commits, incrementing the > weight while walking on a part of the graph that is single strand of > pearls, or doing the "count the reachable ones the hard way" when > you hit a merge [*1*], but either

Re: [PATCH 01/16] bisect: write about `bisect next` in documentation

2016-02-27 Thread Stephan Beyer
Hi, On 02/26/2016 07:47 PM, Junio C Hamano wrote: > But I wonder if it is safe and sane to encourage "checking out other > branches during a bisect session." as you cannot tell what other > crazy things they will do while on "other branches". I do not think > we even try to (and I do not think

[PATCH 13/16] bisect: prepare for different algorithms based on find_all

2016-02-25 Thread Stephan Beyer
ll_weights() for the "git rev-list --bisect-all" command. All other bisect-related commands will use compute_relevant_weights(). Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 116 --- 1 file changed, 97 insertions(+), 1

[PATCH 05/16] bisect: get rid of recursion in count_distance()

2016-02-25 Thread Stephan Beyer
Large repositories with a huge amount of merge commits in the bisection process could lead to stack overflows in git bisect. In order to prevent this, this commit uses an *iterative* version for counting the number of ancestors of a commit. Signed-off-by: Stephan Beyer <s-be...@gmx.

[PATCH 01/16] bisect: write about `bisect next` in documentation

2016-02-25 Thread Stephan Beyer
is known. Some user message in git-bisect.sh is changed to reflect that use case. It is also simplified: there is no need to mention running `bisect start` explicitly, because it can be done indirectly using `bisect bad`. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- This patch con

[PATCH 00/16] git bisect improvements

2016-02-25 Thread Stephan Beyer
more patch-related story as "cover letter material" in these patches. Btw: I also wondered about the internationalizaton: no string in bisect.c is marked for translation. Intentionally? Cheers Stephan Beyer (16): bisect: write about `bisect next` in documentation bisect: add test for

[PATCH 07/16] bisect: replace clear_distance() by unique markers

2016-02-25 Thread Stephan Beyer
marker ids that do not need to be cleared afterwards. This speeds up the bisecting process on large repositories with a huge amount of merges. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Yaaay, this is our first gain of performance! My test: ~30 seconds bisect.

[PATCH 03/16] bisect: make bisect compile if DEBUG_BISECT is set

2016-02-25 Thread Stephan Beyer
Setting the macro DEBUG_BISECT to 1 enables debugging information for the bisect algorithm. The code did not compile due to struct changes. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bisect.c b/bi

[PATCH 10/16] bisect: introduce distance_direction()

2016-02-25 Thread Stephan Beyer
We introduce the concept of rising and falling distances (in addition to a halfway distance). This will be useful in subsequent commits. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-)

[PATCH 16/16] bisect: get back halfway shortcut

2016-02-25 Thread Stephan Beyer
The documentation says that when the maximum possible distance is found, the algorithm stops immediately. That feature is reestablished by this commit. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- In my tests, I have not seen any gain of performance by doing this... but it's fa

[PATCH 09/16] bisect: extract get_distance() function from code duplication

2016-02-25 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- We will also use that function more often later. bisect.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bisect.c b/bisect.c index 76f2445..afdd1c4 100644 --- a/bisect.c +++ b/bisect.c @@ -38,6

[PATCH 08/16] bisect: use commit instead of commit list as arguments when appropriate

2016-02-25 Thread Stephan Beyer
It makes no sense that the argument for count_distance() and halfway() is a commit list when only its first commit is relevant. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- This is just some kind of minor code cleanup. The typical "while at it", you know it, I guess.

[PATCH 02/16] bisect: add test for the bisect algorithm

2016-02-25 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- To be honest: the test could be better, it could be more "targeted", i.e. the example commit history could be smaller and just consider all the cases and corner cases and whatever. However, I made it first to understand the algo

[PATCH 15/16] bisect: compute best bisection in compute_relevant_weights()

2016-02-25 Thread Stephan Beyer
This commit gets rid of the O(#commits) extra overhead of the best_bisection() function. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 43 ++- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/bisect.c b/bisect.c index 8

[PATCH 11/16] bisect: make total number of commits global

2016-02-25 Thread Stephan Beyer
The total number of commits in a bisect process is a property of the bisect process. Making this property global helps to make the code clearer. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 74 ++-- 1 file chang

[PATCH 06/16] bisect: use struct node_data array instead of int array

2016-02-25 Thread Stephan Beyer
This is a preparation for subsequent changes. During a bisection process, we want to augment commits with further information to improve speed. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 61 ++--- 1 file chang

[PATCH 04/16] bisect: make algorithm behavior independent of DEBUG_BISECT

2016-02-25 Thread Stephan Beyer
If DEBUG_BISECT is set to 1, bisect does not only show debug information but also changes the algorithm behavior: halfway() is always false. This commit makes the algorithm independent of DEBUG_BISECT. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 2 -- 1 file chan

[PATCH 14/16] bisect: use a modified breadth-first search to find relevant weights

2016-02-25 Thread Stephan Beyer
). Merge commits from that collection are considered for further visits as soon as all their parents have been visited. Their weights are computed using compute_weight(). Each BFS walk ends when the computed weight is falling or halfway. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- In

[PATCH v2 21/21] bisect: get back halfway shortcut

2016-04-10 Thread Stephan Beyer
The documentation says that when the maximum possible distance is found, the algorithm stops immediately. That feature is reestablished by this commit. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Notes: I plugged a memory leak here. bisect.c | 18 +- 1 file c

[PATCH v2 20/21] bisect: compute best bisection in compute_relevant_weights()

2016-04-10 Thread Stephan Beyer
This commit gets rid of the O(#commits) extra overhead of the best_bisection() function. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Notes: I made the best_bisection structure be allocated on the heap because it will get free()d when the code is invoked by git re

[PATCH v2 00/21] git bisect improvements

2016-04-10 Thread Stephan Beyer
ood for inclusion. :) Cheers 1. https://www.mail-archive.com/git@vger.kernel.org/msg86353.html Stephan Beyer (21): bisect: write about `bisect next` in documentation bisect: allow 'bisect run' if no good commit is known t/test-lib-functions.sh: generalize test_cmp_rev t: use test_cmp_rev() wh

[PATCH v2 12/21] bisect: replace clear_distance() by unique markers

2016-04-10 Thread Stephan Beyer
marker ids that do not need to be cleared afterwards. This speeds up the bisecting process on large repositories with a huge amount of merges. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-)

[PATCH v2 15/21] bisect: introduce distance_direction()

2016-04-10 Thread Stephan Beyer
We introduce the concept of rising and falling distances (in addition to a halfway distance). This will be useful in subsequent commits. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-)

[PATCH v2 19/21] bisect: use a bottom-up traversal to find relevant weights

2016-04-10 Thread Stephan Beyer
uot; using compute_weight() when we hit a merge commit. A traversal ends when the computed weight is falling or halfway. This way, commits with too high weight to be relevant are never visited (and their weights are never computed). Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Notes: I reph

[PATCH v2 04/21] t: use test_cmp_rev() where appropriate

2016-04-10 Thread Stephan Beyer
test_cmp_rev() from t/test-lib-functions.sh is used to make many tests clearer. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Notes: This change is in some way independent of the bisect topic but the next patch is based on this (for t6030). t/t2012-checkout-l

[PATCH v2 07/21] bisect: plug the biggest memory leak

2016-04-10 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bisect.c b/bisect.c index 7996c29..901e4d3 100644 --- a/bisect.c +++ b/bisect.c @@ -984,6 +984,8 @@ int bisect_next_all(const char *prefix, int no_checkout) e

[PATCH v2 09/21] bisect: make algorithm behavior independent of DEBUG_BISECT

2016-04-10 Thread Stephan Beyer
If DEBUG_BISECT is set to 1, bisect does not only show debug information but also changes the algorithm behavior: halfway() is always false. This commit makes the algorithm independent of DEBUG_BISECT. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 2 -- 1 file chan

[PATCH v2 08/21] bisect: make bisect compile if DEBUG_BISECT is set

2016-04-10 Thread Stephan Beyer
Setting the macro DEBUG_BISECT to 1 enables debugging information for the bisect algorithm. The code did not compile due to struct changes. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bisect.c b/bi

[PATCH v2 17/21] bisect: rename count_distance() to compute_weight()

2016-04-10 Thread Stephan Beyer
is renamed to "compute_weight()", and it also directly sets the computed weight. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bisect.c b/bisect.c index 2b415ad..a254f28 100644 --- a/bisect.c

[PATCH v2 02/21] bisect: allow 'bisect run' if no good commit is known

2016-04-10 Thread Stephan Beyer
Now that the documentation talks about bisecting without a good commit being known, this should also be allowed for "git bisect run". Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Notes: This is a new patch in the patchset. git-bisect.sh | 17 - 1

[PATCH v2 16/21] bisect: make total number of commits global

2016-04-10 Thread Stephan Beyer
The total number of commits in a bisect process is a property of the bisect process. Making this property global helps to make the code clearer. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 74 ++-- 1 file chang

[PATCH v2 13/21] bisect: use commit instead of commit list as arguments when appropriate

2016-04-10 Thread Stephan Beyer
It makes no sense that the argument for count_distance() and halfway() is a commit list when only its first commit is relevant. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bisect.c b/bi

[PATCH v2 14/21] bisect: extract get_distance() function from code duplication

2016-04-10 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bisect.c b/bisect.c index 2c1102f..cfd406c 100644 --- a/bisect.c +++ b/bisect.c @@ -38,6 +38,14 @@ static inline struct node_data *node_data(

[PATCH v2 11/21] bisect: use struct node_data array instead of int array

2016-04-10 Thread Stephan Beyer
This is a preparation for subsequent changes. During a bisection process, we want to augment commits with further information to improve speed. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 61 ++--- 1 file chang

[PATCH v2 05/21] t6030: generalize test to not rely on current implementation

2016-04-10 Thread Stephan Beyer
the algorithm works. This commit generalizes the test t6030 such that it works even if the bisect algorithm uses its degree of freedom to choose another commit. While at it, fix some indentation issues: use tabs instead of 4 spaces. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- t/t6030-

[PATCH v2 03/21] t/test-lib-functions.sh: generalize test_cmp_rev

2016-04-10 Thread Stephan Beyer
revision coincides with the expected revision. While at it, the side effect of generating two (temporary) files is removed. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- t/test-lib-functions.sh | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/t/te

[PATCH v2 18/21] bisect: prepare for different algorithms based on find_all

2016-04-10 Thread Stephan Beyer
ll_weights() for the "git rev-list --bisect-all" command. All other bisect-related commands will use compute_relevant_weights(). Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- bisect.c | 116 --- 1 file changed, 97 insertions(+), 1

[PATCH v2 10/21] bisect: get rid of recursion in count_distance()

2016-04-10 Thread Stephan Beyer
Large repositories with a huge amount of merge commits in the bisection process could lead to stack overflows in git bisect. In order to prevent this, this commit uses an *iterative* version for counting the number of ancestors of a commit. Signed-off-by: Stephan Beyer <s-be...@gmx.

[PATCH v2 01/21] bisect: write about `bisect next` in documentation

2016-04-10 Thread Stephan Beyer
is known. Some user message in git-bisect.sh is changed to reflect that use case. It is also simplified: there is no need to mention running `bisect start` explicitly, because it can be done indirectly using `bisect bad`. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Notes: I rep

[PATCH v2 06/21] bisect: add test for the bisect algorithm

2016-04-10 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Notes: Based on the review by Christian Couder, I use test_cmp_rev() instead of non-standard test ... -o ... t/t8010-bisect-algorithm.sh | 155 1 file changed, 155 insertions(+) creat

Re: [PATCH v2 05/21] t6030: generalize test to not rely on current implementation

2016-04-10 Thread Stephan Beyer
On 04/10/2016 09:16 PM, Junio C Hamano wrote: > Torsten Bögershausen writes: > >> Portabily: >> Since yesterday/yesterweek the usage of hard-coded >> #!/bin/sh had shown to be problematic > > That is not a new revelation, though ;-) It is just that these are > problematic to

Re: [PATCH 00/16] git bisect improvements

2016-03-21 Thread Stephan Beyer
Hi Pranit, On 03/20/2016 07:50 PM, Pranit Bauva wrote: > I have been recently following this series of patches and it seems a > bit stale. These patches haven't been followed up with improvement > patches. I'm on vacation at the moment. Patchset v1 contains some bugs. So I just updated the

Re: [PATCH v2 03/21] t/test-lib-functions.sh: generalize test_cmp_rev

2016-04-24 Thread Stephan Beyer
Hi, On 04/15/2016 10:00 PM, Junio C Hamano wrote: > Stephan Beyer <s-be...@gmx.net> writes: > >> test_cmp_rev() took exactly two parameters, the expected revision >> and the revision to test. This commit generalizes this function >> such that it takes any nu

Re: Automatically Add .gitignore Files

2017-02-08 Thread Stephan Beyer
> I am tempted to say that there should be a way to somehow forbid use > of the "-m" option to "git commit" by default, until the user gains > more familiarity with use of Git. Since I am using git, I am tempted to say that "git commit -m" should be abolished. If I tell somebody how to use git, I

Re: Git bisect does not find commit introducing the bug

2017-02-17 Thread Stephan Beyer
Hi, On 02/17/2017 11:29 PM, Alex Hoffman wrote: > According to the documentation "git bisect" is designed "to find the > commit that introduced a bug" . > I have found a situation in which it does not returns the commit I expected. > In order to reproduce the problem: For the others who are too

Re: [RFC PATCH] show decorations at the end of the line

2017-02-14 Thread Stephan Beyer
Hi, On 02/13/2017 09:30 AM, Junio C Hamano wrote: > Linus Torvalds writes: > >> On Sat, Feb 11, 2017 at 10:02 AM, Linus Torvalds >> wrote: >>> >>> I've signed off on this, because I think it's an "obvious" improvement, >>> but I'm

[RFC] stash --continue

2017-01-15 Thread Stephan Beyer
Hi, a git-newbie-ish co-worker uses git-stash sometimes. Last time he used "git stash pop", he got into a merge conflict. After he resolved the conflict, he did not know what to do to get the repository into the wanted state. In his case, it was only "git add " followed by a "git reset" and a

Re: [RFC] stash --continue

2017-01-18 Thread Stephan Beyer
Hi, On 01/18/2017 04:41 PM, Marc Branchaud wrote: > On 2017-01-16 05:54 AM, Johannes Schindelin wrote: >> On Mon, 16 Jan 2017, Stephan Beyer wrote: >>> a git-newbie-ish co-worker uses git-stash sometimes. Last time he used >>> "git stash pop", he got int

Re: [PATCH v15 23/27] bisect--helper: `bisect_replay` shell function in C

2016-11-21 Thread Stephan Beyer
Okay Pranit, this is the last patch for me to review in this series. Now that I have a coarse overview of what you did, I have the general remark that imho the "terms" variable should simply be global instead of being passed around all the time. I also had some other remarks but I forgot

Re: [PATCH v15 15/27] bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C

2016-11-21 Thread Stephan Beyer
Hi Pranit, in this mail I review the "second part" of your patch: the transition of bisect_next and bisect_auto_next to C. On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 1d3e17f..fcd7574 100644 > ---

Re: [PATCH v15 19/27] bisect--helper: `bisect_state` & `bisect_head` shell function in C

2016-11-21 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > Reimplement the `bisect_state` shell function in C and also add a > subcommand `--bisect-state` to `git-bisect--helper` to call it from > git-bisect.sh . > > Using `--bisect-state` subcommand is a temporary measure to port shell > function to C

Re: [PATCH v15 07/27] bisect--helper: `bisect_reset` shell function in C

2016-11-16 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 4254d61..d84ba86 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -84,12 +89,47 @@ static int write_terms(const char *bad, const char *good) >

Re: [PATCH v15 08/27] bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C

2016-11-16 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index d84ba86..c542e8b 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -123,13 +123,40 @@ static int bisect_reset(const char *commit) > return

Re: [PATCH v15 09/27] bisect--helper: `bisect_write` shell function in C

2016-11-17 Thread Stephan Beyer
Hi, I've only got some minors to mention here ;) On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index c542e8b..3f19b68 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -19,9 +19,15 @@ static const char

Re: [PATCH v15 22/27] bisect--helper: `bisect_log` shell function in C

2016-11-17 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 493034c..c18ca07 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -858,6 +858,23 @@ static int bisect_state(struct bisect_terms *terms, > const

Re: [PATCH v15 12/27] bisect--helper: `get_terms` & `bisect_terms` shell function in C

2016-11-17 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 317d671..6a5878c 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c [...] > +static int bisect_terms(struct bisect_terms *terms, const char **argv, int

Re: [PATCH v15 11/27] bisect--helper: `bisect_next_check` & bisect_voc shell function in C

2016-11-17 Thread Stephan Beyer
Hi Pranit, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > Also reimplement `bisect_voc` shell function in C and call it from > `bisect_next_check` implementation in C. Please don't! ;D > +static char *bisect_voc(char *revision_type) > +{ > + if (!strcmp(revision_type, "bad")) > +

Re: [PATCH v15 10/27] bisect--helper: `check_and_set_terms` shell function in C

2016-11-17 Thread Stephan Beyer
Hi Pranit, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 3f19b68..c6c11e3 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -20,6 +20,7 @@ static const char * const git_bisect_helper_usage[] = { >

Re: [PATCH v15 01/27] bisect--helper: use OPT_CMDMODE instead of OPT_BOOL

2016-11-15 Thread Stephan Beyer
Hi, On 10/27/2016 06:59 PM, Junio C Hamano wrote: > Does any of you (and others on the list) have time and inclination > to review this series? Me, currently. ;) Besides the things I'm mentioning in respective patch e-mails, I wonder why several bisect--helper commands are prefixed by "bisect";

Re: [PATCH v15 04/27] bisect--helper: `bisect_clean_state` shell function in C

2016-11-15 Thread Stephan Beyer
On 11/15/2016 10:40 PM, Junio C Hamano wrote: > Stephan Beyer <s-be...@gmx.net> writes: > >>> +int bisect_clean_state(void) >>> +{ >>> + int result = 0; >>> + >>> + /* There may be some refs packed during bisection */ >>>

Re: [PATCH v15 13/27] bisect--helper: `bisect_start` shell function partially in C

2016-11-15 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 6a5878c..1d3e17f 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -24,6 +27,8 @@ static const char * const git_bisect_helper_usage[] = { >

Re: [PATCH v15 04/27] bisect--helper: `bisect_clean_state` shell function in C

2016-11-15 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/bisect.c b/bisect.c > index 6f512c2..45d598d 100644 > --- a/bisect.c > +++ b/bisect.c > @@ -1040,3 +1046,40 @@ int estimate_bisect_steps(int all) > > return (e < 3 * x) ? n : n - 1; > } > + > +static int

Re: [PATCH v15 18/27] bisect--helper: `bisect_autostart` shell function in C

2016-11-20 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 502bf18..1767916 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -422,6 +425,7 @@ static int bisect_next(...) > { > int res, no_checkout;

Re: [PATCH v15 13/27] bisect--helper: `bisect_start` shell function partially in C

2016-11-20 Thread Stephan Beyer
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote: > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c > index 6a5878c..1d3e17f 100644 > --- a/builtin/bisect--helper.c > +++ b/builtin/bisect--helper.c > @@ -403,6 +408,205 @@ static int bisect_terms(struct bisect_terms *terms, > const

Re: [PATCH v15 15/27] bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C

2016-11-20 Thread Stephan Beyer
Hi Pranit, this one is hard to review because you do two or three commits in one here. I think the first commit should be the exit()->return conversion, the second commit is next and autonext, and the third commit is the pretty trivial bisect_start commit ;) However, you did it this way and it's

Re: [PATCH v15 13/27] bisect--helper: `bisect_start` shell function partially in C

2016-11-20 Thread Stephan Beyer
On 11/20/2016 09:01 PM, Stephan Beyer wrote: > First, replace the current set_terms() by > > static void set_terms(struct bisect_terms *terms, const char *bad, > const char *good) > { > terms->term_good = xstrdup

Re: [PATCH v15 02/27] bisect: rewrite `check_term_format` shell function in C

2016-11-14 Thread Stephan Beyer
Hi, I saw in the recent "What's cooking" mail that this is still waiting for review, so I thought I could interfere and help reviewing it from a non-git-developer point of view. But only two commits for today. The first one seems fine. The second one makes me write this mail ;-) On 10/14/2016

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-07 Thread Stephan Beyer
Hi, On 12/06/2016 07:58 PM, Junio C Hamano wrote: > I was burned a few times with this in the past few years, but it did > not irritate me often enough that I didn't write it down. But I > think this is serious enough that deserves attention from those who > were involved. > > A short

Re: [PATCH 4/5] Make sequencer abort safer

2016-12-08 Thread Stephan Beyer
Hi, I'm a little afraid of feeding Parkinson's law of triviality here, but... ;) On 12/08/2016 06:27 PM, Junio C Hamano wrote: > Johannes Schindelin <johannes.schinde...@gmx.de> writes: > >> On Wed, 7 Dec 2016, Stephan Beyer wrote: >> >>> diff --git a/se

[PATCH 2/5] am: Change safe_to_abort()'s not rewinding error into a warning

2016-12-07 Thread Stephan Beyer
;, instead she just has to check the HEAD. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- builtin/am.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index 7cf40e6f2..826f18ba1 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -2134,7 +2134

[PATCH 4/5] Make sequencer abort safer

2016-12-07 Thread Stephan Beyer
r the single-pick case because it is handled differently. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- sequencer.c | 49 + 1 file changed, 49 insertions(+) diff --git a/sequencer.c b/sequencer.c index 30b10ba14..c9b560ac1 100644 --- a/sequence

[PATCH 3/5] Add test that cherry-pick --abort does not unsafely change HEAD

2016-12-07 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- t/t3510-cherry-pick-sequence.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 7b7a89dbd..372307c21 100755 --- a/t/t3510-cherry-pick-sequence.sh +

[PATCH 1/5] am: Fix filename in safe_to_abort() error message

2016-12-07 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- Okay let's give it a try. Some minor things that I found are also in this patchset (patch 01, 02 and 05). The branch can also be found on https://github.com/sbeyer/git/commits/sequencer-abort-safety builtin/am.c | 2 +- 1 file chan

[PATCH 5/5] sequencer: Remove useless get_dir() function

2016-12-07 Thread Stephan Beyer
This function is used only once, for the removal of the directory. It is not used for the creation of the directory nor anywhere else. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- sequencer.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sequenc

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-07 Thread Stephan Beyer
Hi, On 12/07/2016 09:04 PM, Junio C Hamano wrote: > Stephan Beyer <s-be...@gmx.net> writes: > >> [1] By the way: git cherry-pick --quit, git rebase --forget ... >> different wording for the same thing makes things unintuitive. > > It is not too late to STOP

Re: [PATCH v2 4/5] Make sequencer abort safer

2016-12-10 Thread Stephan Beyer
On 12/10/2016 09:04 PM, Jeff King wrote: > On Sat, Dec 10, 2016 at 08:56:26PM +0100, Christian Couder wrote: > >>> +static int rollback_is_safe(void) >>> +{ >>> + struct strbuf sb = STRBUF_INIT; >>> + struct object_id expected_head, actual_head; >>> + >>> + if

[PATCH v2 3/5] Add test that cherry-pick --abort does not unsafely change HEAD

2016-12-09 Thread Stephan Beyer
The test expects failure because it is a current breakage reported by Junio C Hamano. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- t/t3510-cherry-pick-sequence.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherr

[PATCH v2 1/5] am: Fix filename in safe_to_abort() error message

2016-12-09 Thread Stephan Beyer
Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- builtin/am.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index 6981f42ce..7cf40e6f2 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -2124,7 +2124,7 @@ static int safe_to_abort(const

[PATCH v2 2/5] am: Change safe_to_abort()'s not rewinding error into a warning

2016-12-09 Thread Stephan Beyer
;, instead she just has to check the HEAD. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- builtin/am.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index 7cf40e6f2..826f18ba1 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -2134,7 +2134

[PATCH v2 4/5] Make sequencer abort safer

2016-12-09 Thread Stephan Beyer
r the single-pick case because it is handled differently. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- sequencer.c | 48 + t/t3510-cherry-pick-sequence.sh | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/seque

[PATCH v2 5/5] sequencer: Remove useless get_dir() function

2016-12-09 Thread Stephan Beyer
This function is used only once, for the removal of the directory. It is not used for the creation of the directory nor anywhere else. Signed-off-by: Stephan Beyer <s-be...@gmx.net> --- sequencer.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sequenc

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-09 Thread Stephan Beyer
Hi Junio, On 12/09/2016 07:07 PM, Junio C Hamano wrote: > Duy Nguyen writes: >> Having the same operation with different names only increases git >> reputation of bad/inconsistent UI. Either forget is renamed to quit, >> or vice versa. I prefer forget, but the decision is

git add -p with unmerged files (was: git add -p with new file)

2016-12-13 Thread Stephan Beyer
Hi, While we're on the topic that "git add -p" should behave like the "normal" "git add" (not "git add -u"): what about unmerged changes? When I have merge conflicts, I almost always use my aliases "edit-unmerged" and "add-unmerged": $ git config --global --list | grep unmerged

Re: [PATCH v15 23/27] bisect--helper: `bisect_replay` shell function in C

2016-12-06 Thread Stephan Beyer
Hi Pranit and Christian and Lars ;) On 12/07/2016 12:02 AM, Pranit Bauva wrote: > On Tue, Nov 22, 2016 at 6:19 AM, Stephan Beyer <s-be...@gmx.net> wrote: >> Okay Pranit, >> >> this is the last patch for me to review in this series. >> >> Now that I have a

Re: [PATCH v15 19/27] bisect--helper: `bisect_state` & `bisect_head` shell function in C

2016-12-06 Thread Stephan Beyer
Hi Pranit, On 12/06/2016 11:40 PM, Pranit Bauva wrote: > On Tue, Nov 22, 2016 at 5:42 AM, Stephan Beyer <s-be...@gmx.net> wrote: >> On 10/14/2016 04:14 PM, Pranit Bauva wrote: >>> +static int bisect_state(struct bisect_terms *terms, const char **argv, >>&g

Re: [PATCH v15 08/27] bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C

2016-12-17 Thread Stephan Beyer
Hi Pranit, On 12/16/2016 08:00 PM, Pranit Bauva wrote: > On Wed, Dec 7, 2016 at 1:03 AM, Pranit Bauva wrote: >>> I don't understand why the return value is int and not void. To avoid a >>> "return 0;" line when calling this function? >> >> Initially I thought I would be

Re: [PATCH v15 08/27] bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C

2016-12-17 Thread Stephan Beyer
Hi Pranit, On 12/16/2016 08:35 PM, Pranit Bauva wrote: > On Thu, Nov 17, 2016 at 5:17 AM, Stephan Beyer <s-be...@gmx.net> wrote: >> On 10/14/2016 04:14 PM, Pranit Bauva wrote: >>> diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c >>> index d84ba86.

Re: [PATCH v2 01/34] sequencer: support a new action: 'interactive rebase'

2016-12-17 Thread Stephan Beyer
Hi, On 12/14/2016 08:29 PM, Junio C Hamano wrote: > Johannes Schindelin writes: >> -/* We will introduce the 'interactive rebase' mode later */ >> static inline int is_rebase_i(const struct replay_opts *opts) >> { >> -return 0; >> +return opts->action ==

Re: git add -p with new file

2016-12-12 Thread Stephan Beyer
Hi Ariel, On 12/09/2016 07:26 PM, Ariel wrote: > On Wed, 7 Dec 2016, Duy Nguyen wrote: >> We could improve it a bit, suggesting the user to do git add -N. But >> is there a point of using -p on a new file? > > I got into the habit of always using -p as a way of checking my diffs > before

Re: git add -p with new file

2016-12-12 Thread Stephan Beyer
Hi, On 12/11/2016 02:00 PM, Jeff King wrote: > On Sat, Dec 10, 2016 at 02:04:33PM -0800, Junio C Hamano wrote: >> Jeff King writes: >>> On Fri, Dec 09, 2016 at 01:43:24PM -0500, Ariel wrote: >>> ... But it doesn't have to be that way. You could make add -p identical to add

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-09 Thread Stephan Beyer
On 12/09/2016 08:24 PM, Stephan Beyer wrote: > t3510 also shows another use-case for --quit: the title says it all: > "cherry-pick --quit" to "cherry-pick --abort" I should've read what I actually pasted. I wanted to paste: '--quit keeps HEAD and conflicted index

Re: [PATCH v15 15/27] bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C

2017-01-01 Thread Stephan Beyer
Hi Pranit, On 12/31/2016 11:43 AM, Pranit Bauva wrote: >>> + >>> +static int bisect_auto_next(struct bisect_terms *terms, const char *prefix) >>> +{ >>> + if (!bisect_next_check(terms, NULL)) >>> + return bisect_next(terms, prefix); >>> + >>> + return 0; >>> +} >> >> Hmm, the

  1   2   >