git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC][GSoC] Project proposal: convert interactive rebase to C
@ 2018-03-17 19:14 Alban Gruin
  2018-03-17 20:29 ` Christian Couder
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alban Gruin @ 2018-03-17 19:14 UTC (permalink / raw)
  To: git; +Cc: Christian Couder, Johannes Schindelin

Hi,

here is my first draft of my proposal for the GSoC, about the "convert 
interactive rebase to C" project. Any feedback is welcome :)

---
ABSTRACT
git is a modular source control management software, and all of its 
subcommands are programs on their own. A lot of them are written in C, but a 
couple of them are shell or Perl scripts. This is the case of git-rebase--
interactive (or interactive rebase), which is a shell script. Rewriting it in 
C would improve its performance, its portability, and maybe its robustness.


ABOUT `git-rebase{,--interactive}`

git-rebase allows to re-apply changes on top of another branch. For instance, 
when a local branch and a remote branch have diverged, git-rebase can re-unify 
them, applying each change made on the local branch on top of the remote 
branch.

git-rebase--interactive is used to reorganize commits by reordering, 
rewording, or squashing them. To achieve this purpose, git opens the list of 
commits to be modified in a text editor (hence the interactivity), as well as 
the actions to be performed for each of them.


PROJECT GOALS

The goal of this project is to rewrite git-rebase--interactive in C as it has 
been discussed on the git mailing list[1], for multiple reasons :

Performance improvements
Shell scripts are inherently slow. That’s because each command is a program by 
itself. So, for each command, the shell interpreter has to spawn a new process 
and to load a new program.

Those commands can be other git commands. Sometimes, they are wrappers to call 
internal C functions (eg. git-rebase--helper), something shell scripts can’t 
do natively. These wrappers basically parse the parameters, then start the 
appropriate function, which is
obviously slower than just calling a function from C.

Other commands can be POSIX utilities (eg. sed, cut, etc.). They have their 
own problems (speed aside), namely portability.

Portability improvements
Shell scripts often relies on many of those POSIX utilities, which are not 
necessarily natively available on all platforms (most notably, Windows), or 
may have more or less features depending on the implementation.


APPROXIMATIVE TIMELINE

Community bonding — April 23, 2018 – May 14, 2018
During the community bonding, I would like to dive into git’s codebase, and to 
understand what git-rebase--interactive does under the hood. At the same time, 
I’d communicate with the community and my mentor, seeking for clarifications, 
and asking questions about how things should or should not be done.

Weeks 1 & 2 — May 14, 2018 – May 28, 2018
First, I would refactor --preserve-merges in its own shell script, as 
described in Dscho’s email.

Weeks 3 & 4 — May 18, 2018 – June 11, 2018
Then, I would start to rewrite git-rebase--interactive, and get rid of git-
rebase--helper.

Weeks 5 to 9 — June 11, 2018 – July 15, 2018
During this period, I would continue to rewrite git-rebase--interactive.

Weeks 10 & 11 — July 16, 2018 – July 29, 2018
In the second half of July, I would look for bugs in the new code, test it, 
and improve its coverage.

Weeks 12 — July 30, 2018 – August 5, 2018
In the last week, I would polish the code where needed, in order to improve 
for performance or to make the code more readable.


ABOUT ME

My name is Alban Gruin, I am an undergraduate at the Paul Sabatier University 
in Toulouse, France, where I have been studying Computer Sciences for the past 
year and a half. My timezone currently is UTC+01:00, but will be UTC+02:00 
starting from March 25th, because of the daylight saving time in Europe.

I have been programming in C for the last 5 years. I learned using freely 
available resources online, and by attending class ever since last year.

I am also quite familiar with shell scripts, and I have been using git for the 
last 3 years. 

My e-mail address is alban <dot> gruin <at> gmail <dot> com. My IRC nick is 
abngrn.

My micro-project was "userdiff: add built-in pattern for golang"[2][3].

---

You can find the Google Doc version here[4].

Regards,
Alban Gruin

[1] https://public-inbox.org/git/alpine.DEB.2.20.1609021432070.129229@virtualbox/
[2] https://public-inbox.org/git/20180228172906.30582-1-alban.gruin@gmail.com/
[3] https://git.kernel.org/pub/scm/git/git.git/commit/?id=1dbf0c0a
[4] https://docs.google.com/document/d/1Jx0w867tVAht7QI1_prieiXg_iQ_nTloOyaIIOnm85g/edit?usp=sharing



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-03-25  0:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-17 19:14 [RFC][GSoC] Project proposal: convert interactive rebase to C Alban Gruin
2018-03-17 20:29 ` Christian Couder
2018-03-20 16:29 ` Johannes Schindelin
2018-03-21 11:04   ` Alban Gruin
2018-03-21 23:51     ` Johannes Schindelin
2018-03-22 22:03 ` Alban Gruin
2018-03-24  7:43   ` Christian Couder
2018-03-25  0:43   ` [RFC v3][GSoC] " Alban Gruin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).