Re: [GSoC] GSoC with git, week 6

2018-06-11 Thread Pratik Karki
Hi, My blog post is also up. https://prertik.github.io/post/week-06 And nice blog post, Alban. :-) Cheers, Pratik

Re: [GSoC] GSoC with git, week 7

2018-06-20 Thread Pratik Karki
On Tue, Jun 19, 2018 at 12:33 AM, Paul-Sebastian Ungureanu wrote: > Hello! > > > On 18.06.2018 20:34, Alban Gruin wrote: >> >> Hi, >> >> I published a new blog post here: >> >>https://blog.pa1ch.fr/posts/2018/06/18/en/gsoc2018-week-7.html >> >> It’s shorter than the last one, but feel free to

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-26 Thread Pratik Karki
Hi, On Tue, Jun 26, 2018 at 3:00 AM Johannes Schindelin wrote: > Pratik refactored some code from sequencer.c into checkout.c/checkout.h > today to do exactly that. It is not polished yet, but probably will be > tomorrow. It provides a function `int detach_head_to(struct object_oid > *oid, const

[GSoC] [PATCH 0/5] rebase: rewrite rebase in C

2018-06-28 Thread Pratik Karki
minimal builtin rebase which supports running `git rebase ` and also serves to ask for reviews. Pratik Karki (5): Start TODO-rebase.sh rebase: start implementing it as a builtin rebase: refactor common shell functions into their own file sequencer: refactor the code to detach HEAD to checkout.c

[PATCH 5/5] builtin/rebase: support running "git rebase "

2018-06-28 Thread Pratik Karki
duced by a previous commit to perform initial checkout. Signed-off-by: Pratik Karki --- builtin/rebase.c | 231 ++- 1 file changed, 229 insertions(+), 2 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 1152b7229..2f90389c2 100644

[PATCH 4/5] sequencer: refactor the code to detach HEAD to checkout.c

2018-06-28 Thread Pratik Karki
. Signed-off-by: Pratik Karki --- checkout.c | 64 + checkout.h | 3 +++ sequencer.c | 58 +--- 3 files changed, 72 insertions(+), 53 deletions(-) diff --git a/checkout.c b/checkout.c index

[PATCH 2/5] rebase: start implementing it as a builtin

2018-06-28 Thread Pratik Karki
-c rebase.useBuiltin=true rebase ...` Signed-off-by: Pratik Karki --- .gitignore| 1 + Makefile | 3 +- builtin.h | 1 + builtin/rebase.c | 55 +++ git-rebase.sh

[PATCH 1/5] Start TODO-rebase.sh

2018-06-28 Thread Pratik Karki
This is a verbatim copy of `git-rebase.sh`. This acts as a tracker for components to be converted and to find the progress of current conversion of `git-rebase.sh` to `builtin/rebase.c`. The commented parts denote the converted parts. Signed-off-by: Pratik Karki --- TODO-rebase.sh | 738

[PATCH 3/5] rebase: refactor common shell functions into their own file

2018-06-28 Thread Pratik Karki
functions *directly* from C, bypassing `git-rebase.sh`. Therefore those functions need to live in a separate file: we need to be able to call `.git-rebase--common` in that script snippet so that those functions are defined. Signed-off-by: Pratik Karki --- .gitignore| 1 + Makefile

Re: [PATCH 1/5] Start TODO-rebase.sh

2018-06-28 Thread Pratik Karki
Hi, This is a patch I keep in wip-rebase branch[1][2]. It shouldn't be applied to `pu`. This main objective of this file in the branch is to keep track of the converted shell scripts of `git-rebase.sh` and plan on the conversion of other remaining parts. [1]: https://github.com/prertik/git/tree/

[PATCH v2 2/4] rebase: refactor common shell functions into their own file

2018-07-02 Thread Pratik Karki
functions *directly* from C, bypassing `git-rebase.sh`. Therefore those functions need to live in a separate file: we need to be able to call `. git-rebase--common` in that script snippet so that those functions are defined. Signed-off-by: Pratik Karki --- .gitignore| 1 + Makefile

[PATCH v2 1/4] rebase: start implementing it as a builtin

2018-07-02 Thread Pratik Karki
-c rebase.useBuiltin=true rebase ...` Signed-off-by: Pratik Karki --- .gitignore| 1 + Makefile | 3 +- builtin.h | 1 + builtin/rebase.c | 55 +++ git-rebase.sh

[PATCH v2 3/4] sequencer: refactor the code to detach HEAD to checkout.c

2018-07-02 Thread Pratik Karki
. Signed-off-by: Pratik Karki --- checkout.c | 64 + checkout.h | 3 +++ sequencer.c | 58 +--- 3 files changed, 72 insertions(+), 53 deletions(-) diff --git a/checkout.c b/checkout.c index

[GSoC] [PATCH v2 0/4] rebase: rewrite rebase in C

2018-07-02 Thread Pratik Karki
ssage in `builtin/rebase: support running "git-rebase ". Pratik Karki (4): rebase: start implementing it as a builtin rebase: refactor common shell functions into their own file sequencer: refactor the code to detach HEAD to checkout.c builtin/rebase: support runn

[PATCH v2 4/4] builtin/rebase: support running "git rebase "

2018-07-02 Thread Pratik Karki
from checkout.c introduced by a previous commit to perform initial checkout. Signed-off-by: Pratik Karki --- builtin/rebase.c | 229 ++- 1 file changed, 228 insertions(+), 1 deletion(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index c0c9

[GSoC] [PATCH v3 0/4] rebase: rewrite rebase in C

2018-07-06 Thread Pratik Karki
d_env()` which would be visible by spawned process from rebase backends as this is not safe. Pratik Karki (4): rebase: start implementing it as a builtin rebase: refactor common shell functions into their own file sequencer: refactor the code to detach HEAD to checkout.c builtin/rebase: su

[PATCH v3 1/4] rebase: start implementing it as a builtin

2018-07-06 Thread Pratik Karki
messing up the GIT_* environment variables when we need to fall back to exec()ing the shell script. The test of builtin rebase can be done by `git -c rebase.useBuiltin=true rebase ...` Signed-off-by: Pratik Karki --- .gitignore| 1 + Makefile

[PATCH v3 2/4] rebase: refactor common shell functions into their own file

2018-07-06 Thread Pratik Karki
following commits. Signed-off-by: Pratik Karki --- .gitignore| 1 + Makefile | 1 + git-legacy-rebase.sh | 62 +-- git-rebase--common.sh | 61 ++ 4 files changed, 64 insertions(+), 61

[PATCH v3 4/4] builtin/rebase: support running "git rebase "

2018-07-06 Thread Pratik Karki
` because those variables would then be visible by processes spawned from the rebase backends. Instead, we work hard to set them in the shell script snippet. The next commits will handle and support all the wonderful rebase options. Signed-off-by: Pratik Karki --- builtin

[PATCH v3 3/4] sequencer: refactor the code to detach HEAD to checkout.c

2018-07-06 Thread Pratik Karki
. It does not make a huge difference, and the upside is that this closes a few (unlikely) code paths where the index would not be unlocked upon error. Signed-off-by: Pratik Karki --- checkout.c | 64 + checkout.h | 3 +++ sequencer.c | 58

[GSoC] [PATCH v4 0/4] rebase: rewrite rebase in C

2018-07-08 Thread Pratik Karki
minimal builtin rebase which supports running `git rebase ` and also serves to ask for reviews. Changes since v3: - Fix commit message of `rebase: start implementing it as a builtin`. - Acknowledge Junio's style reviews. - Acknowledge Johannes Schindelin's review. Pratik Karki (4)

[PATCH v4 4/4] builtin/rebase: support running "git rebase "

2018-07-08 Thread Pratik Karki
` because those variables would then be visible by processes spawned from the rebase backends. Instead, we work hard to set them in the shell script snippet. The next commits will handle and support all the wonderful rebase options. Signed-off-by: Pratik Karki --- builtin

[PATCH v4 3/4] sequencer: refactor the code to detach HEAD to checkout.c

2018-07-08 Thread Pratik Karki
. It does not make a huge difference, and the upside is that this closes a few (unlikely) code paths where the index would not be unlocked upon error. Signed-off-by: Pratik Karki --- checkout.c | 64 + checkout.h | 3 +++ sequencer.c | 58

[PATCH v4 2/4] rebase: refactor common shell functions into their own file

2018-07-08 Thread Pratik Karki
following commits. Signed-off-by: Pratik Karki --- .gitignore| 1 + Makefile | 1 + git-legacy-rebase.sh | 69 ++- git-rebase--common.sh | 68 ++ 4 files changed, 72 insertions(+), 67

[PATCH v4 1/4] rebase: start implementing it as a builtin

2018-07-08 Thread Pratik Karki
the config directly to avoid messing up the GIT_* environment variables when we need to fall back to exec()ing the shell script. The test of builtin rebase can be done by `git -c rebase.useBuiltin=true rebase ...` Signed-off-by: Pratik Karki --- .gitignore| 1

Re: [PATCH v4 1/4] rebase: start implementing it as a builtin

2018-07-09 Thread Pratik Karki
Hi, On Mon, Jul 9, 2018 at 2:21 PM Eric Sunshine wrote: > > On Mon, Jul 9, 2018 at 3:59 AM Andrei Rybak wrote: > > On 2018-07-08 20:01, Pratik Karki wrote: > > > +static int use_builtin_rebase(void) > > > +{ > > > + struct child_process cp = CHILD_PROC

Re: [PATCH v4 3/4] sequencer: refactor the code to detach HEAD to checkout.c

2018-07-09 Thread Pratik Karki
On Mon, Jul 9, 2018 at 10:27 PM Junio C Hamano wrote: > > Pratik Karki writes: > > > In the upcoming builtin rebase, we will have to start by detaching > > the HEAD, just like shell script version does. Essentially, we have > > to do the same thing as `git ch

Re: [PATCH v4 3/4] sequencer: refactor the code to detach HEAD to checkout.c

2018-07-09 Thread Pratik Karki
Hi, On Mon, Jul 9, 2018 at 3:16 AM Johannes Schindelin wrote: > > Hi Pratik, > > On Sun, 8 Jul 2018, Pratik Karki wrote: > > > diff --git a/checkout.c b/checkout.c > > index bdefc888ba..da68915fd7 100644 > > --- a/checkout.c > > +++ b/checkout.c >

Re: [GSoC] GSoC with git, week 10

2018-07-11 Thread Pratik Karki
Hi, On Tue, Jul 10, 2018 at 10:05 PM Alban Gruin wrote: > > Hi, > > I published a new blog post: > > https://blog.pa1ch.fr/posts/2018/07/10/en/gsoc2018-week-10.html > Nice work. Sorry for late notification, my blog is up too. https://prertik.github.io/post/week-10 Cheers, Pratik

Re: [PATCH] fixup! builtin/rebase: support running "git rebase "

2018-07-21 Thread Pratik Karki
> +static GIT_PATH_FUNC(merge_dir, "rebase-merge") > First of all, I apologize for not replying earlier to your review. I have already fixed this macro in my local repository. The new iteration of my patches was being held due to fixup of `detach_head_to()` and I will soon submit a new iteration of patch within a day or two. Thank you for pointing this out. Cheers, Pratik Karki

[PATCH v5 1/3] rebase: start implementing it as a builtin

2018-07-30 Thread Pratik Karki
the config directly to avoid messing up the GIT_* environment variables when we need to fall back to exec()ing the shell script. The test of builtin rebase can be done by `git -c rebase.useBuiltin=true rebase ...` Signed-off-by: Pratik Karki --- .gitignore| 1

[GSoC] [PATCH v5 0/3] rebase: rewrite rebase in C

2018-07-30 Thread Pratik Karki
pointed out by Duy Nguyen). - Fix the macro `GIT_PATH_FUNC` which expands to function definition and doesn't require semicolons (as pointed out by Beat Bolli). Pratik Karki (3): rebase: start implementing it as a builtin rebase: refactor common shell functions into their own

[PATCH v5 2/3] rebase: refactor common shell functions into their own file

2018-07-30 Thread Pratik Karki
following commits. Signed-off-by: Pratik Karki --- Unchanged since v4. .gitignore| 1 + Makefile | 1 + git-legacy-rebase.sh | 69 ++- git-rebase--common.sh | 68 ++ 4 files changed, 72

[PATCH v5 3/3] builtin/rebase: support running "git rebase "

2018-07-30 Thread Pratik Karki
he next commits will handle and support all the wonderful rebase options. Signed-off-by: Pratik Karki --- builtin/rebase.c | 350 ++- 1 file changed, 349 insertions(+), 1 deletion(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index c44addb2a4..586

Re: [GSoC] [PATCH v5 0/3] rebase: rewrite rebase in C

2018-07-31 Thread Pratik Karki
Hi Junio, During recent development, I found out that `v5` has some issues and shouldn't be merged into `next`. I implemented more options and ran a couple of regression tests from which I figured out that certain choices I made in those commits need to be reconsidered. During recent development,

Re: What's cooking in git.git (Aug 2018, #01; Thu, 2)

2018-08-02 Thread Pratik Karki
Hi Junio, On Fri, Aug 3, 2018 at 4:47 AM Junio C Hamano wrote: > > * pk/rebase-in-c (2018-07-30) 3 commits > - builtin/rebase: support running "git rebase " > - rebase: refactor common shell functions into their own file > - rebase: start implementing it as a builtin > > Rewrite of the "rebas

[GSoC] [PATCH v6 1/3] rebase: start implementing it as a builtin

2018-08-06 Thread Pratik Karki
the config directly to avoid messing up the GIT_* environment variables when we need to fall back to exec()ing the shell script. The test of builtin rebase can be done by `git -c rebase.useBuiltin=true rebase ...` Signed-off-by: Pratik Karki --- Unchanged since v5. .gitignore

[GSoC] [PATCH v6 3/3] builtin/rebase: support running "git rebase "

2018-08-06 Thread Pratik Karki
commits will handle and support all the wonderful rebase options. Signed-off-by: Pratik Karki --- builtin/rebase.c | 365 ++- 1 file changed, 364 insertions(+), 1 deletion(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index c44addb2a4..e69

[GSoC] [PATCH v6 0/3] rebase: rewrite rebase in C

2018-08-06 Thread Pratik Karki
but upcoming patches will add more functionality like moving or updating to original branch. - Lots of changes that fix bugs discovered while getting the test suite to pass with the patch series. Pratik Karki (3): rebase: start implementing it as a builtin rebase: refactor c

[GSoC] [PATCH v6 2/3] rebase: refactor common shell functions into their own file

2018-08-06 Thread Pratik Karki
following commits. Signed-off-by: Pratik Karki --- Unchanged since v5. .gitignore| 1 + Makefile | 1 + git-legacy-rebase.sh | 69 ++- git-rebase--common.sh | 68 ++ 4 files changed, 72

[PATCH 04/11] builtin rebase: support --quiet

2018-08-08 Thread Pratik Karki
OPT_NEGBIT(). Signed-off-by: Pratik Karki --- builtin/rebase.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index b79f9b0a9f..19fa4d3fc4 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -79,6 +79,10 @@ struct rebase_options {

[PATCH 03/11] builtin rebase: handle the pre-rebase hook (and add --no-verify)

2018-08-08 Thread Pratik Karki
This commit converts the equivalent part of the shell script `git-legacy-rebase.sh` to run the pre-rebase hook (unless disabled), and to interrupt the rebase with error if the hook fails. Signed-off-by: Pratik Karki --- builtin/rebase.c | 11 +++ 1 file changed, 11 insertions(+) diff

[PATCH 05/11] builtin rebase: support the `verbose` and `diffstat` options

2018-08-08 Thread Pratik Karki
) git_default_config(). Signed-off-by: Pratik Karki --- builtin/rebase.c | 60 ++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 19fa4d3fc4..2d3f1d65fb 100644 --- a/builtin/rebase.c +++ b/builtin

[PATCH 02/11] builtin rebase: support `git rebase --onto A...B`

2018-08-08 Thread Pratik Karki
r approach would be nice, this would create more complexity than it is of current. Currently, for simple convenience, the `get_oid_mb()` function is used whose return value does not discern between those two error conditions. Signed-off-by: Pratik Karki --- builtin/rebase.c | 8 +++- 1 file

[PATCH 01/11] builtin rebase: support --onto

2018-08-08 Thread Pratik Karki
ces to the parse_options() call (which "eats" argv[0]), the argc is now expected to be lower by one after this patch, compared to before this patch: argv[0] no longer refers to the command name, but to the first (non-option) command-line parameter. Signed-off-by: Pratik Karki --- b

[PATCH 06/11] builtin rebase: require a clean worktree

2018-08-08 Thread Pratik Karki
This commit reads the index of the repository for rebase and checks whether the repository is ready for rebase. Signed-off-by: Pratik Karki --- builtin/rebase.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index 2d3f1d65fb..afef0b0046

[GSoC] [PATCH 00/11] A minimal builtin rebase

2018-08-08 Thread Pratik Karki
help of my GSoC mentors since, this is the final week of GSoC and other GSoC students most likely have submitted their respective works which will need lots of review. Pratik Karki (11): builtin rebase: support --onto builtin rebase: support `git rebase --onto A...B` builtin rebase: handle the

[PATCH 11/11] builtin rebase: support `git rebase `

2018-08-08 Thread Pratik Karki
This commit adds support for `switch-to` which is used to switch to the target branch if needed. The equivalent codes found in shell script `git-legacy-rebase.sh` is converted to builtin `rebase.c`. Signed-off-by: Pratik Karki --- builtin/rebase.c | 48

[PATCH 07/11] builtin rebase: try to fast forward when possible

2018-08-08 Thread Pratik Karki
, say, running an interactive rebase). Signed-off-by: Pratik Karki --- builtin/rebase.c | 72 1 file changed, 72 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index afef0b0046..52a218cd18 100644 --- a/builtin/rebase.c +++ b/builtin

[PATCH 08/11] builtin rebase: support --force-rebase

2018-08-08 Thread Pratik Karki
In this commit, we add support to `--force-rebase` option. The equivalent part of the shell script found in `git-legacy-rebase.sh` is converted as faithfully as possible to C. The --force-rebase option ensures that the rebase does not simply fast-forward even if it could. Signed-off-by: Pratik

[PATCH 10/11] builtin rebase: only store fully-qualified refs in `options.head_name`

2018-08-08 Thread Pratik Karki
uld really only want a valid, fully-qualified ref name as value, and NULL for detached HEADs, using "detached HEAD" for display only. Make it so. Signed-off-by: Pratik Karki --- builtin/rebase.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/builti

[PATCH 09/11] builtin rebase: start a new rebase only if none is in progress

2018-08-08 Thread Pratik Karki
To run a new rebase, there needs to be a check to assure that no other rebase is in progress. New rebase operation cannot start until an ongoing rebase operation completes or is terminated. Signed-off-by: Pratik Karki --- builtin/rebase.c | 48 +++- 1

[PATCH 4/7] builtin rebase: support --quit

2018-08-08 Thread Pratik Karki
With this patch, the builtin rebase handles the `--quit` action which can be used to abort a rebase without rolling back any changes performed during the rebase (this is useful when a user forgot that they were in the middle of a rebase and continued working normally). Signed-off-by: Pratik Karki

[PATCH 3/7] builtin rebase: support --abort

2018-08-08 Thread Pratik Karki
This commit teaches the builtin rebase the "abort" action, which a user can call to roll back a rebase that is in progress. Signed-off-by: Pratik Karki --- builtin/rebase.c | 20 1 file changed, 20 insertions(+) diff --git a/builtin/rebase.c b/builtin/reba

[PATCH 2/7] builtin rebase: support --skip

2018-08-08 Thread Pratik Karki
This commit adds the option `--skip` which is used to restart rebase after skipping the current patch. Signed-off-by: Pratik Karki --- builtin/rebase.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index 10da4c978b..7a903838b1 100644

[PATCH 1/7] builtin rebase: support --continue

2018-08-08 Thread Pratik Karki
variables are not actually stored there, such as `upstream`. The shell script version simply does not set them, but for consistency, we unset them in the builtin version. Signed-off-by: Pratik Karki --- builtin/rebase.c | 115 +-- strbuf.c | 9

[PATCH 5/7] builtin rebase: support --edit-todo and --show-current-patch

2018-08-08 Thread Pratik Karki
). Signed-off-by: Pratik Karki --- builtin/rebase.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 0d805480a1..e3dd2f511e 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -472,6 +472,8 @@ int cmd_rebase

[GSoC] [PATCH 0/7] builtin rebase actions

2018-08-08 Thread Pratik Karki
to on. These patch series are built on top of each other, i.e. they depend on this order. Pratik Karki (7): builtin rebase: support --continue builtin rebase: support --skip builtin rebase: support --abort builtin rebase: support --quit builtin rebase: support --edit-todo and --show-cur

[PATCH 7/7] builtin rebase: stop if `git am` is in progress

2018-08-08 Thread Pratik Karki
This commit checks for the file `applying` used by `git am` in `rebase-apply/` and if the file is present it means `git am` is in progress so it errors out. Signed-off-by: Pratik Karki --- builtin/rebase.c | 5 + 1 file changed, 5 insertions(+) diff --git a/builtin/rebase.c b/builtin

[PATCH 6/7] builtin rebase: actions require a rebase in progress

2018-08-08 Thread Pratik Karki
This commit prevents actions (such as --continue, --skip) from running when there is no rebase in progress. Signed-off-by: Pratik Karki --- builtin/rebase.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index e3dd2f511e..1344e071f3 100644 --- a

[GSoC] [PATCH 00/18] builtin rebase options

2018-08-08 Thread Pratik Karki
tch series are built on top of each other, i.e. they depend on this order. Pratik Karki (18): builtin rebase: allow selecting the rebase "backend" builtin rebase: support --signoff builtin rebase: support --rerere-autoupdate builtin rebase: support --committer-date-is-author-

[PATCH 06/18] builtin rebase: support `ignore-date` option

2018-08-08 Thread Pratik Karki
This commit adds support for `--ignore-date` which is passed to `git am` to easily change the dates of the rebased commits. Signed-off-by: Pratik Karki --- builtin/rebase.c | 8 1 file changed, 8 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index 7490d215ef

[PATCH 03/18] builtin rebase: support --rerere-autoupdate

2018-08-08 Thread Pratik Karki
The `--rerere-autoupdate` option allows rerere to update the index with resolved conflicts. This commit follows closely the equivalent part of `git-legacy-rebase.sh`. Signed-off-by: Pratik Karki --- builtin/rebase.c | 25 + 1 file changed, 25 insertions(+) diff --git a

[PATCH 08/18] builtin rebase: support `--autosquash`

2018-08-08 Thread Pratik Karki
support this, we also add a custom rebase_config() function in this commit that will be used instead (and falls back to) git_default_config(). Signed-off-by: Pratik Karki --- builtin/rebase.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c

[PATCH 07/18] builtin rebase: support `keep-empty` option

2018-08-08 Thread Pratik Karki
when figuring out which backend to use, the C version needs to use a different route because the backend will already be chosen during the `parse_options()` call. Signed-off-by: Pratik Karki --- builtin/rebase.c | 24 1 file changed, 24 insertions(+) diff --git a/builtin

[PATCH 05/18] builtin rebase: support `ignore-whitespace` option

2018-08-08 Thread Pratik Karki
This commit adds support for the `--ignore-whitespace` option of the rebase command. This option is simply passed to the `--am` backend. Signed-off-by: Pratik Karki --- builtin/rebase.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index

[PATCH 04/18] builtin rebase: support --committer-date-is-author-date

2018-08-08 Thread Pratik Karki
This option is simply handed down to `git am` by way of setting the `git_am_opt` variable that is handled by the `git-rebase--am` backend. Signed-off-by: Pratik Karki --- builtin/rebase.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index

[PATCH 02/18] builtin rebase: support --signoff

2018-08-08 Thread Pratik Karki
This commit adds support for `--signoff` which is used to add a `Signed-off-by` trailer to all the rebased commits. The actual handling is left to the rebase backends. Signed-off-by: Pratik Karki --- builtin/rebase.c | 17 + 1 file changed, 17 insertions(+) diff --git a/builtin

[PATCH 01/18] builtin rebase: allow selecting the rebase "backend"

2018-08-08 Thread Pratik Karki
tly interactive" rebase, i.e. a rebase that should show the todo list, while `--preserve-merges` alone is not interactive (and t5520 tests for this via `git pull --rebase=preserve`). Signed-off-by: Pratik Karki --- builtin/rebase.c | 37 + 1 file cha

[PATCH 10/18] builtin rebase: support `-C` and `--whitespace=`

2018-08-08 Thread Pratik Karki
This commit converts more code from the shell script version to the builtin rebase. In this instance, we just have to be careful to keep support for passing multiple `--whitespace` options, as the shell script version does so, too. Signed-off-by: Pratik Karki --- builtin/rebase.c | 23

[PATCH 13/18] builtin rebase: support `--allow-empty-message` option

2018-08-08 Thread Pratik Karki
-message` overrides that behaviour which will allow the commits having empty messages to continue in rebase operation. Note: a very recent change made this the default in the shell scripted `git rebase`, therefore the builtin rebase does the same. Signed-off-by: Pratik Karki --- builtin/rebase.c | 7

[PATCH 11/18] builtin rebase: support `--autostash` option

2018-08-08 Thread Pratik Karki
into a builtin. Signed-off-by: Pratik Karki --- builtin/rebase.c | 117 +++ 1 file changed, 109 insertions(+), 8 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 4437c86513..a6bfa73915 100644 --- a/builtin/rebase.c +++ b/builtin

[PATCH 12/18] builtin rebase: support `--exec`

2018-08-08 Thread Pratik Karki
the empty string to `cmd` by default, we *unset* it here because the code looks nicer and it does not change the behavior. The `--exec` option requires `--interactive` machinery. Signed-off-by: Pratik Karki --- builtin/rebase.c | 18 ++ 1 file changed, 18 insertions(+) diff

[PATCH 09/18] builtin rebase: support `--gpg-sign` option

2018-08-08 Thread Pratik Karki
This commit introduces support for `--gpg-sign` option which is used to GPG-sign commits. Signed-off-by: Pratik Karki --- builtin/rebase.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index 79ba65fd75..cd9caf4841 100644

[PATCH 17/18] builtin rebase: add support for custom merge strategies

2018-08-08 Thread Pratik Karki
When running a rebase in non-am mode, it uses the recursive merge to cherry-pick the commits, and the rebase command allows to configure the merge strategy to be used in this operation. This commit adds that support to the builtin rebase. Signed-off-by: Pratik Karki --- builtin/rebase.c | 57

[PATCH 16/18] builtin rebase: support `fork-point` option

2018-08-08 Thread Pratik Karki
This commit adds support for `--fork-point` and `--no-fork-point`. This is converted as-is from `git-legacy-rebase.sh`. Signed-off-by: Pratik Karki --- builtin/rebase.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index 0b94d2daaa

[PATCH 15/18] merge-base --fork-point: extract libified function

2018-08-08 Thread Pratik Karki
did not matter when the function was called in `git rev-parse --fork-point` because in that command, the process definitely did not traverse any commits before exiting. Signed-off-by: Pratik Karki --- builtin/merge-base.c | 81 commit.c | 81

[PATCH 14/18] builtin rebase: support --rebase-merges[=[no-]rebase-cousins]

2018-08-08 Thread Pratik Karki
The mode to rebase non-linear branches is now supported by the builtin rebase, too. Signed-off-by: Pratik Karki --- builtin/rebase.c | 21 + 1 file changed, 21 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index dfb1e6c25b..0b94d2daaa 100644 --- a/builtin

[PATCH 18/18] builtin rebase: support --root

2018-08-08 Thread Pratik Karki
This option allows to rebase entire histories up to, and including, the root commit. The conversion from the shell script is straight-forward, apart from the fact that we do not have to write an empty tree in C. Signed-off-by: Pratik Karki --- builtin/rebase.c | 31

[GSoC] [PATCH 0/6] builtin rebase rest

2018-08-08 Thread Pratik Karki
n't due to my patches) for extra testing other than my system. The next in line patch series which I'll be sending out today are: default to builtin rebase: This will turn on the feature-complete builtin rebase to on. These patch series are built on top of each other, i.e. they depend on

[PATCH 4/6] builtin rebase: show progress when connected to a terminal

2018-08-08 Thread Pratik Karki
In this commit, we pass `--progress` to the `format-patch` command if stderr is connected to an interactive terminal, unless we're in quiet mode. This `--progress` option will be used in `format-patch` to show progress reports on stderr as patches are generated. Signed-off-by: Pratik

[PATCH 2/6] builtin rebase: optionally pass custom reflogs to reset_head()

2018-08-08 Thread Pratik Karki
In the next patch, we will make use of that in the code that fast-forwards to `onto` whenever possible. Signed-off-by: Pratik Karki --- builtin/rebase.c | 33 + 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c

[PATCH 1/6] builtin rebase: optionally auto-detect the upstream

2018-08-08 Thread Pratik Karki
The `git rebase` command, when called without the `` command-line argument, automatically looks for the upstream branch configured for the current branch. With this commit, the builtin rebase learned that trick, too. Signed-off-by: Pratik Karki --- builtin/rebase.c | 44

[PATCH 5/6] builtin rebase: use no-op editor when interactive is "implied"

2018-08-08 Thread Pratik Karki
t;. All it does is to replace the editor by a dummy one (`:` is the Unix command that takes arbitrary command-line parameters, ignores them and simply exits with success). Signed-off-by: Pratik Karki --- builtin/rebase.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/rebase.c

[PATCH 3/6] builtin rebase: fast-forward to onto if it is a proper descendant

2018-08-08 Thread Pratik Karki
When trying to rebase onto a direct descendant of HEAD, we can take a shortcut and fast-forward instead. This commit makes it so. Signed-off-by: Pratik Karki --- builtin/rebase.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index

[PATCH 6/6] builtin rebase: error out on incompatible option/mode combinations

2018-08-08 Thread Pratik Karki
While working on the GSoC project to convert the rebase command to a builtin, the rebase command learned to error out on certain command-line option combinations that cannot work, such as --whitespace=fix with --interactive. This commit converts that code. Signed-off-by: Pratik Karki

[PATCH 1/1] rebase: default to using the builtin rebase

2018-08-08 Thread Pratik Karki
Now that the builtin rebase is feature-complete, we should use it by default. Let's keep the legacy scripted version around for the time being; Once the builtin rebase is well-tested enough, we can remove `git-legacy-rebase.sh`. Signed-off-by: Pratik Karki --- builtin/rebase.c | 2 +- 1

[GSoC] [PATCH 0/1] default to builtin rebase

2018-08-08 Thread Pratik Karki
ther, i.e. they depend on this order. Pratik Karki (1): rebase: default to using the builtin rebase builtin/rebase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.18.0

[GSoC] [PATCH] test: avoid pipes in git related commands for test suite

2018-03-13 Thread Pratik Karki
ed by pipe. Signed-off-by: Pratik Karki --- t/t7001-mv.sh| 24 t/t9104-git-svn-follow-parent.sh | 4 ++-- t/t9110-git-svn-use-svm-props.sh | 36 ++-- t/t9111-git-svn-use-svnsync-props.sh

[GSoC][PATCH] test: avoid pipes in git related commands for test suite

2018-03-19 Thread Pratik Karki
up with my university stuffs. Please do review this patch as before. I will correct it if needed. Cheers, Pratik Karki Avoid using pipes downstream of Git commands since the exit codes of commands upstream of pipes get swallowed, thus potentially hiding failure of those commands. Instead, capture G

[RFC] [GSoC] Project proposal: convert scripts to builtins

2018-03-20 Thread Pratik Karki
Hi, This is my draft for my proposal on "Convert Scripts to builtin" for GSoC. Please review and provide feedbacks. https://gist.github.com/prertik/daaa73a39d3ce30811d9a208043dc235 Cheers, Pratik Karki

Re: [RFC] [GSoC] Project proposal: convert scripts to builtins

2018-03-20 Thread Pratik Karki
Hi, This is my draft for my proposal on "Convert Scripts to builtins" for GSoC. Please review and provide feedback. Cheers, Pratik Karki Convert Scripts to builtins === Abstract Many components of Git are still in the form of shell and Perl scripts

Re: [RFC] [GSoC] Project proposal: convert scripts to builtins

2018-03-20 Thread Pratik Karki
with git-stash. Thank you for directing me to the un-merged matches. Now, I can find the points where the patch couldn't be effective and work towards completing those effective things. Please provide feedback for this updated proposal. Cheers, Pratik Karki Convert Scripts to bui

[GSoC][PATCH v3] test: avoid pipes in git related commands for test

2018-03-21 Thread Pratik Karki
0180319173204.31952-1-predatoram...@gmail.com/ [2]: https://github.com/git/git/blob/master/Documentation/SubmittingPatches - >8 Avoid using pipes downstream of Git commands since the exit codes of command

[GSoC][PATCH v4] test: avoid pipes in git related commands for test

2018-03-23 Thread Pratik Karki
wed, thus potentially hiding failure of those commands. Instead, capture Git command output to a file and apply the downstream command(s) to that file. Signed-off-by: Pratik Karki --- t/t5300-pack-object.sh | 8 ++--- t/t5510-fetch.sh | 8 ++--- t/t7

[GSoC] Info: git log --oneline improvements

2018-03-23 Thread Pratik Karki
n my proposal. [1]: https://public-inbox.org/git/20180321061605.27814-1-predatoram...@gmail.com/ Cheers, Pratik Karki

[GSoC] Re: Info: git log --oneline improvements

2018-03-24 Thread Pratik Karki
te my previous proposal[1] and make it more worthy. Can you review it and explain what I might be lacking there? Thank you for your time. [1]: https://public-inbox.org/git/20180321061605.27814-1-predatoram...@gmail.com/ Cheers, Pratik Karki

[GSoC][PATCH v5] test: avoid pipes in git related commands for test

2018-03-27 Thread Pratik Karki
and apply the downstream command(s) to that file. Signed-off-by: Pratik Karki --- t/t5300-pack-object.sh | 8 ++--- t/t5510-fetch.sh | 8 ++--- t/t7001-mv.sh | 22 ++--- t/t7003-filter-branch

Re: GSoC students and mentors in 2018

2018-04-25 Thread Pratik Karki
, wants to convert git-stash > into a builtin. > > Alban Gruin and Pratik Karki want to convert parts of git-rebase into > a builtin. Both are mentored by Christian and myself. > > The slots were just announced today, please join me in welcoming them > to the Git mailing list!

[GSoC] Info: new blog series of my work on Git GSoC '18

2018-05-01 Thread Pratik Karki
in. [1]: https://prertik.github.io/categories/git/ Cheers, Pratik Karki

  1   2   >