git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 8, 2018, 21:14 UTC
Message-ID
<nycvar.QRO.7.76.6.1807082311540.75@tvgsbejvaqbjf.bet>
In-Reply-To
<20180708180104.17921-1-predatoramigo@gmail.com>
Hi Pratik,
On Sun, 8 Jul 2018, Pratik Karki wrote:
Show 24 quoted lines
> As a GSoC project, I have been working on the builtin rebase.
> 
> The motivation behind the rewrite of rebase i.e. from shell script to C
> are for following reasons:
> 
> 1.  Writing shell scripts and getting it to production is much faster
>     than doing the equivalent in C but lacks in performance and extra
>     workarounds are needed for non-POSIX platforms.
> 
> 2.  Git for Windows is at loss as the installer size increases due to
>     addition of extra dependencies for the shell scripts which are usually
>     available in POSIX compliant platforms.
> 
> This series of patches serves to demonstrate a minimal builtin rebase
> which supports running `git rebase <upstream>` 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.

The range-diff looks like this (and makes sense to me; you might want to fix the typo s/retun/return/, but that's all for now):

-- snipsnap --
 1:  7baec70f219 !  1:  42778b20edf rebase: start implementing it as a builtin
    @@ -13,6 +13,12 @@
         be able to conveniently test new features by configuring
         `rebase.useBuiltin`.
    +    In the original difftool conversion, if sane_execvp() that attempts to
    +    run the legacy scripted version returned with non-negative status, the
    +    command silently exited without doing anything with success, but
    +    sane_execvp() should not retun with non-negative status in the first
    +    place, so we use die() to notice such an abnormal case.
    +
         We intentionally avoid reading 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
 2:  f385f42dc56 !  2:  a28be7308e6 rebase: refactor common shell functions into their own file
    @@ -45,6 +45,20 @@
     diff --git a/git-legacy-rebase.sh b/git-legacy-rebase.sh
     --- a/git-legacy-rebase.sh
     +++ b/git-legacy-rebase.sh
    +@@
    + LF='
    + '
    + ok_to_skip_pre_rebase=
    +-resolvemsg="
    +-$(gettext 'Resolve all conflicts manually, mark them as resolved with
    +-"git add/rm <conflicted_files>", then run "git rebase --continue".
    +-You can instead skip this commit: run "git rebase --skip".
    +-To abort and get back to the state before "git rebase", run "git rebase --abort".')
    +-"
    ++
    + squash_onto=
    + unset onto
    + unset restrict_revision
     @@
      true)     gpg_sign_opt=-S ;;
      *)        gpg_sign_opt= ;;
    @@ -128,6 +142,13 @@
     +++ b/git-rebase--common.sh
     @@
     +
    ++resolvemsg="
    ++$(gettext 'Resolve all conflicts manually, mark them as resolved with
    ++"git add/rm <conflicted_files>", then run "git rebase --continue".
    ++You can instead skip this commit: run "git rebase --skip".
    ++To abort and get back to the state before "git rebase", run "git rebase --abort".')
    ++"
    ++
     +write_basic_state () {
     +  echo "$head_name" > "$state_dir"/head-name &&
     +  echo "$onto" > "$state_dir"/onto &&
 3:  147699bd195 =  3:  7591098c4d1 sequencer: refactor the code to detach HEAD to checkout.c
 4:  bbaa4264caa !  4:  f8429e950a4 builtin/rebase: support running "git rebase <upstream>"
    @@ -232,13 +232,14 @@
     +  }
     +
     +  /*
    -+  * If the branch to rebase is given, that is the branch we will rebase
    -+  * branch_name -- branch/commit being rebased, or HEAD (already detached)
    -+  * orig_head -- commit object name of tip of the branch before rebasing
    -+  * head_name -- refs/heads/<that-branch> or "detached HEAD"
    -+  */
    ++   * If the branch to rebase is given, that is the branch we will rebase
    ++   * branch_name -- branch/commit being rebased, or
    ++   *                HEAD (already detached)
    ++   * orig_head -- commit object name of tip of the branch before rebasing
    ++   * head_name -- refs/heads/<that-branch> or "detached HEAD"
    ++   */
     +  if (argc > 1)
    -+           die ("TODO: handle switch_to");
    ++           die("TODO: handle switch_to");
     +  else {
     +          /* Do not need to switch branches, we are already on it.  */
     +          options.head_name =
Previous: Johannes SchindelinNext: Pratik Karki
Message 51 of 61 in “rebase: rewrite rebase in C”
  1. Pratik KarkiJun 28, 2018
  2. 1/5 Start TODO-rebase.shPratik Karki, Jun 28, 2018
  3. Pratik KarkiJun 28, 2018
  4. 2/5 rebase: start implementing it as a builtinPratik Karki, Jun 28, 2018
  5. Christian CouderJun 28, 2018
  6. Stefan BellerJun 28, 2018
  7. 3/5 rebase: refactor common shell functions into their own filePratik Karki, Jun 28, 2018
  8. Christian CouderJun 28, 2018
  9. Stefan BellerJun 28, 2018
  10. 4/5 sequencer: refactor the code to detach HEAD to checkout.cPratik Karki, Jun 28, 2018
  11. Christian CouderJun 28, 2018
  12. Stefan BellerJun 28, 2018
  13. 5/5 builtin/rebase: support running "git rebase <upstream>"Pratik Karki, Jun 28, 2018
  14. Stefan BellerJun 28, 2018
  15. [GSoC] [PATCH v2 0/4] rebase: rewrite rebase in CPratik Karki, Jul 2, 2018
  16. 1/4 rebase: start implementing it as a builtinPratik Karki, Jul 2, 2018
  17. Junio C HamanoJul 3, 2018
  18. 2/4 rebase: refactor common shell functions into their own filePratik Karki, Jul 2, 2018
  19. Junio C HamanoJul 3, 2018
  20. 3/4 sequencer: refactor the code to detach HEAD to checkout.cPratik Karki, Jul 2, 2018
  21. Junio C HamanoJul 3, 2018
  22. 4/4 builtin/rebase: support running "git rebase <upstream>"Pratik Karki, Jul 2, 2018
  23. Junio C HamanoJul 3, 2018
  24. [GSoC] [PATCH v3 0/4] rebase: rewrite rebase in CPratik Karki, Jul 6, 2018
  25. 1/4 rebase: start implementing it as a builtinPratik Karki, Jul 6, 2018
  26. Junio C HamanoJul 6, 2018
  27. 2/4 rebase: refactor common shell functions into their own filePratik Karki, Jul 6, 2018
  28. Johannes SchindelinJul 6, 2018
  29. 3/4 sequencer: refactor the code to detach HEAD to checkout.cPratik Karki, Jul 6, 2018
  30. 4/4 builtin/rebase: support running "git rebase <upstream>"Pratik Karki, Jul 6, 2018
  31. Junio C HamanoJul 6, 2018
  32. Christian CouderJul 7, 2018
  33. Johannes SchindelinJul 7, 2018
  34. Junio C HamanoJul 7, 2018
  35. Beat BolliJul 17, 2018
  36. Beat BolliJul 17, 2018
  37. [GSoC] [PATCH v4 0/4] rebase: rewrite rebase in CPratik Karki, Jul 8, 2018
  38. 1/4 rebase: start implementing it as a builtinPratik Karki, Jul 8, 2018
  39. Andrei RybakJul 9, 2018
  40. Eric SunshineJul 9, 2018
  41. Pratik KarkiJul 9, 2018
  42. Duy NguyenJul 22, 2018
  43. 2/4 rebase: refactor common shell functions into their own filePratik Karki, Jul 8, 2018
  44. 3/4 sequencer: refactor the code to detach HEAD to checkout.cPratik Karki, Jul 8, 2018
  45. Johannes SchindelinJul 8, 2018
  46. Pratik KarkiJul 9, 2018
  47. Junio C HamanoJul 9, 2018
  48. Pratik KarkiJul 9, 2018
  49. 4/4 builtin/rebase: support running "git rebase <upstream>"Pratik Karki, Jul 8, 2018
  50. Johannes SchindelinJul 8, 2018
  51. Johannes SchindelinJul 8, 2018
  52. [GSoC] [PATCH v5 0/3] rebase: rewrite rebase in CPratik Karki, Jul 30, 2018
  53. 1/3 rebase: start implementing it as a builtinPratik Karki, Jul 30, 2018
  54. 2/3 rebase: refactor common shell functions into their own filePratik Karki, Jul 30, 2018
  55. 3/3 builtin/rebase: support running "git rebase <upstream>"Pratik Karki, Jul 30, 2018
  56. Pratik KarkiAug 1, 2018
  57. [GSoC] [PATCH v6 0/3] rebase: rewrite rebase in CPratik Karki, Aug 6, 2018
  58. [GSoC] [PATCH v6 3/3] builtin/rebase: support running "git rebase <upstream>"Pratik Karki, Aug 6, 2018
  59. Junio C HamanoAug 16, 2018
  60. [GSoC] [PATCH v6 2/3] rebase: refactor common shell functions into their own filePratik Karki, Aug 6, 2018
  61. [GSoC] [PATCH v6 1/3] rebase: start implementing it as a builtinPratik Karki, Aug 6, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.