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

Converting scripted commands to built-ins, was Re: [GSoC] Exploring Previous year Projects

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 30, 2020, 11:10 UTC
Message-ID
<nycvar.QRO.7.76.6.2001301154170.46@tvgsbejvaqbjf.bet>
In-Reply-To
<86k15ars55.fsf@gmail.com>
Hi Kuba,
On Wed, 29 Jan 2020, Jakub Narebski wrote:
Show 18 quoted lines
> Shourya Shukla <shouryashukla.oo@gmail.com> writes:
>
> > Hello,
> >
> > I was looking at the previous year projects[1] and a project intrigued me, namely:
> > "Convert scripts to builtins".
> >
> > Following from Christian's advice[2], I have decided to focus on my project proposal.
> > I noticed that various commands such as "git bisect", "git web--browse"(it particularly
> > interests me) are still in their "shell" form and will be needed to be converted into
> > their "C" form as per the project description.
> [...]
> > [1]: https://git.github.io/SoC-2019-Ideas/
> > [2]: https://lore.kernel.org/git/CAP8UFD2Fo=2suQDLwzLM-Wg3ZzXpqHw-x0brPtPV0d4dRsgs9A@mail.gmail.com/
>
> As far as I know, "git bisect" is currently being converted from shell
> to C by Miriam Rubio for Outreachy project [3], so I am not sure if it
> would be feasible as GSoC 2020 project.
Indeed. That one "is already taken".
> I'm not sure if it would be possible and if it would make sense to
> convert "git instaweb" and/or it's helper script "git web--browse" from
> shell to C.

I agree, both of those scripts seem not to benefit all that much from being converted, while some people would still consider them to be developed easier as shell scripts.

> I think trying to convert either "git stash" or "git submodule" to C
> would make more sense.

Oh, but `git stash` is already converted. The only two remainining shell scripts for which I would consider a conversion to C to make sense are `git submodule` and `git mergetool`.

Large parts of `git submodule` are already implemented in `git submodule--helper`, so that's a head start (thanks Stephan Beller!).

The `git mergetool` command is a bit trickier, as it consists of three scripts, really, with the `difftool--helper` depending on `mergetool--lib`.

Realistically, I think that it would be possible for a GSoC student who is already very familiar with the code base and with submodules to finish the conversion of `git submodule` in one season.

The same is probably not true for `git mergetool`: it would require a couple of seasons to convert, and a good chunk of the first month would be taken by planning a conversion strategy.

As of the current `master`, the `git-*.sh` scripts are:
# In the process of being converted
git-bisect.sh
# Candidates for being converted

git-difftool--helper.sh git-mergetool--lib.sh git-mergetool.sh git-submodule.sh

# Trivial conversions

git-merge-octopus.sh git-merge-one-file.sh git-merge-resolve.sh

# Already deprecated

git-filter-branch.sh git-legacy-stash.sh git-rebase--preserve-merges.sh

# Is this even needed anymore?
git-quiltimport.sh
# Probably better to leave them as shell scripts

git-instaweb.sh git-request-pull.sh git-web--browse.sh

# Not even Git commands

git-parse-remote.sh git-sh-i18n.sh git-sh-setup.sh

The situation of the Perl scripts to be converted is much nicer:
# Already in code review
git-add--interactive.perl
# Too complex/too dependent on the Perl packages

git-send-email.perl git-svn.perl

# Support for legacy SCMs that are less and less used

git-archimport.perl git-cvsexportcommit.perl git-cvsimport.perl git-cvsserver.perl

So: after `git add -i`, I think we're done with the conversion of the Perl
scripts. Took long enough ;-)

Ciao, Dscho

Show 7 quoted lines
>
> [3]: https://public-inbox.org/git/20200128144026.53128-1-mirucam@gmail.com/t/#u
>
> Best,
> --
> Jakub Narębski
>
Previous: Jakub NarebskiNext: Derrick Stolee
Message 3 of 6 in “[GSoC] Exploring Previous year Projects”
  1. Shourya ShuklaJan 29, 2020
  2. Jakub NarebskiJan 29, 2020
  3. Converting scripted commands to built-ins, was Re: [GSoC] Exploring Previous year ProjectsJohannes Schindelin, Jan 30, 2020
  4. Derrick StoleeJan 30, 2020
  5. Johannes SchindelinJan 31, 2020
  6. Johannes SchindelinJan 31, 2020

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.