GSoC Project Selected | Incremental Rewrite of git bisect

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

GSoC Project Selected | Incremental Rewrite of git bisect

pranitbauva1997
Hey everyone,

I am Pranit Bauva studying Mining Engineering at Indian Institute of
Technology, Kharagpur. I have applied for Google Summer of Code 2016
under Git organization and my project[1], "Incremental Rewrite of git
bisect has been selected under the guidance of mentors namely
Christian Couder and Lars Schneider.

Overview of the project:

Git bisect is a frequently used command which helps the developers in
finding the commit which introduced the regression. Some part of it is
written in shell script. I intend to convert it to portable C code
thus making them builtins. This will increase Git’s portability.


A word of thanks:

Firstly I would really like to thank everyone who was involved in
planning GSoC for Git especially my mentors. Also thanking Eric
Sunshine, SZEDER and Junio for patiently reviewing my micro-project
and helping me through that. It was a really great experience. I had
previously no clue about git bisect and have never used it mainly
because I was never involved with maintaining big projects. Posting my
idea to the mailing list (which initially contained a lot of mistakes)
was extremely helpful. Thanks to Christian Couder, Matthieu Moy,
Johannes Schindelin and Stefan Beller for providing useful comments.
Experimenting by converting one function really helped me a lot to
write the proposal. Thanks Roberto for making submitgit.

The subtle hints dropped were the most helpful. Thanks for explaining
those when I could not pick up those hints in the first time.

Status of Micro-project:
I had finalized v14[1] but recently Junio pointed out that the series
requires ordering and restructuring so I will finish with that. I have
my end semester exams going on so I will try to squeeze out some time
in between and try to work on the patches.

Status of the function conversion:
I had attempted to port a function 'check_term_format' from shell to
C. The last version was v3[2]. In the newer version (there only exist
a local copy as I have neither sent it in the mailing list nor I have
pushed it on github) as one test is not exiting properly. The code
written with confusing error handling and return statements which were
mainly there to help me understand "What's happening and where is it
happening?" As requested by Christian, I will still push these changes
to my github fork[3]. Also the function I have written does not use
the API of git as at that time I wasn't quite familiar with it. I am
still not completely familiar with it but I guess that will take some
time.

Status of learning about git plumbing commands:
I have learned about:
 - git-check-ref-format
 - git-rev-list
 - git-rev-parse

The one's left are:
 - git-symbolic-refs
 - git-show-branch
 - git-update-ref
 - git-for-each-ref

Status of Week 1 of my proposal:
In my 1st week I was going to set up kcov to test the coverage of
shell scripts as gcov does not cover them. kcov is a lot trickier than
gcov which I hadn't realized it before. I tried to use it in a simple
way but it just wasn't possible for me. So I dug further and found a
patch[5] submitted by Dmitry Vyukov. The linux kernel recently started
using kcov for their coverage and to also find bugs by using some
fuzzy logic. Setting this up is well not a piece of cake at least for
me. I tried reading his patch and wasn't quite able to digest it in
the first read but then I didn't look into that further. I would
really like if someone could look this up and recommend whether I
should try and implement this or not in the first week. If let's say I
try to implement it, then I probably think it is more than a week's
job. I recollect Matthieu saying that Paul Tan had used this before.
Could you please explain how he achieved this?

When will I officially start working?
My end semester exams end on 29th April, 2016 and I will reach my home
on 1st May, 2016. I will officially start working from 2nd May, 2016
and will complete reading up on plumbing commands and other API parts
which seems a bit ambitious as for now.

Other remarks:
 - I can now finally use git-send-email when I reach home.
 - I will regularly (weekly) keep posting my progress on my blog[6]
which will be revived  as it has been a bit stale for some time now. I
will also send the text-only version to the mailing list as requested
by Christian.
 - The more I dived in, the more it started to realize that my time
line needs some restructuring which I guess can be determined by the
above paragraphs.
 - I will also work out on a time line and post it on my blog[6] and
send it to mentors.

[1]: https://docs.google.com/document/d/1stnDPA5Hs3u0a8sqoWZicTFpCz1wHP9bkifcKY13Ocw/edit?usp=sharing

[2]: http://thread.gmane.org/gmane.comp.version-control.git/291311

[3]: http://thread.gmane.org/gmane.comp.version-control.git/289599

[4]: https://github.com/pranitbauva1997/git

[5]: http://thread.gmane.org/gmane.linux.kernel/2126762

[6]: http://bauva.in
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: GSoC Project Selected | Incremental Rewrite of git bisect

Johannes Schindelin
Hi Pranit,

On Sun, 24 Apr 2016, Pranit Bauva wrote:

> I am Pranit Bauva studying Mining Engineering at Indian Institute of
> Technology, Kharagpur. I have applied for Google Summer of Code 2016
> under Git organization and my project[1], "Incremental Rewrite of git
> bisect has been selected under the guidance of mentors namely Christian
> Couder and Lars Schneider.

Awesome, congratulations!

Looking forward to seeing your project progress, and to you feeling at
home here in the Git developer community.

Ciao,
Johannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: GSoC Project Selected | Incremental Rewrite of git bisect

Matthieu Moy-2
In reply to this post by pranitbauva1997
Pranit Bauva <[hidden email]> writes:

>  - The more I dived in, the more it started to realize that my time
> line needs some restructuring which I guess can be determined by the
> above paragraphs.

Do not worry too much about the timeline. The timeline you attached to
your project is not a plan to follow, but just a proof that you
understood the amount of work to be done and that you have an idea on
how to accomplish it.

I wouldn't be the first one to write "value [...] Responding to change
over following a plan" ;-).

--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

[GSOC update] Week 1

pranitbauva1997
In reply to this post by pranitbauva1997
My public git.git is available here[1]. I regularly keep pushing my work so
anyone interested can track me there. Feel free to participate in the
discussions going on PRs with my mentors. Your comments are valuable.

The things I was able to do:

 * Finish off with my micro project[2] about adding a config variable for
   git-commit. There is still a little discussion going on about whether
   verbose should be retired and instead "commit.showDiff" should be used.
   Junio also made a little change to squash it with my patch to make the
   patch look more clearer to digest. Its difficult that this will be included
   in the release of 2.8.3

 * I converted the function check_term_format()[3] from shell to C as a
   subcommand. Faced some difficulty but was greatly helped by Christian
   Couder.

 * I converted the function bisect_log()[4] in a branch from the previous
   check-term-format branch as a subcommand. I was waiting for the first patch
   to get queued on maintainer's git.git repo so as to rebase it there and
   then send the patch.

 * I converted the function write_terms()[5] in a branch from the previous
   bisect-log branch as a subcommand and I removed check-term-format subcommand.
   I was waiting for the bisect-log patch to get queued on maintainer's git.git
   repo so as to rebase it there and send send the patch

 * I am currently introducing subcommands and calling them from git-bisect.sh .
   Eric Sunshine had proposed another top bottom approach wherein I first
   implement a skeleton and redirect it to git-bisect.sh so that the test
   suite is still passing. This method was used by Paul Tan in his last year
   GSoC project. Commit ids for reference, e1ea69fa4e and 73c2779f4 .

 * I ignored it and sent another revision of the series to which Junio wasn't
   quite enthusiastic over my reasoning for using subcommand approach. So
   I wrote an email[6] explaining how using subcommand way is beneficial to
   me, reviewers/testers, and my mentors.

 * I am currently waiting for that discussion to come to a conclusion. Till
   then I have paused on a bit.

 * I am now reading on the API part and planning how will I go about with the
   future functions. The functions I have converted till now were quite simple
   ones and the main difficulty lies ahead!

 * Anywhich ways I think this week was quite productive and if I follow this
   speed then the project is in a good shape to be completed well in time.

 * On a lighter note: I will be on a short vacation from 16th May to 19th May.
   So I will be unavailable till that time.

[1]: https://github.com/pranitbauva1997/git
[2]: http://thread.gmane.org/gmane.comp.version-control.git/293635
[3]: https://github.com/pranitbauva1997/git/pull/1
[4]: https://github.com/pranitbauva1997/git/pull/2
[5]: https://github.com/pranitbauva1997/git/pull/3
[6]: http://article.gmane.org/gmane.comp.version-control.git/293909
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

[GSOC Update] Week 2

pranitbauva1997
================================= SUMMARY ==================================
My micro project on adding config variable to git-commit for verbose options
is going to be merged with the master branch soon and will be available for
git 2.8.3 . I also rewrote a few shell functions in C.

My public git.git is available here[1]. I regularly keep pushing my work so
anyone interested can track me there. Feel free to participate in the
discussions going on PRs with my mentors. Your comments are valuable.


=============================== INTRODUCTION  ==============================
The purpose of this project is to convert the git-bisect utility which partly
exists in the form of shell scripts to C code so as to make it more portable.
I plan to do this by converting each function to C and then calling it from
git-bisect.sh so as to use the existing test suite to test the function which
is converted.

Mentors:
Christian Couder <[hidden email]>
Lars Schneider <[hidden email]>


================================== Updates =================================
Things which were done in this week:

 * I have sent the patches[2] for check_term_format() and write_terms() so
   as to demonstrate how I am going to use the subcommand approach wherein
   I will first convert a method and then call it by using a subcommand.
   Then when another method is converted the previous method will be removed
   from the subcommand and will instead be called from the new method. Junio
   has collected this patch and queued it on a branch gitster/pb/bisect and
   is available for testing on the pu branch. I am encouraging people to
   test it and provide useful comments.

 * I have also converted bisect_log() and bisect_voc() whose patches[3] are
   sent to the list. Junio is yet to pick these up.

 * I have converted the function bisect_clean_state() but its in a very
   rudimentary form. Well I generally do like this. I first have a *just*
   working model of a function and then I polish it by introducing the git's
   API and write error handling code and resolve the style issues. Though it
   is available on github[4]. The current version plainly removes the refs
   using the git's API. I am quite aware that refs shouldn't be handled in this way
   (this fact is constantly reminded in the docs). I am reading up on the
   available methods for refs manipulation.

 * I have also sent an independent patch[5] to explicitly test whether
   bisection state is properly cleaned up.

 * Also studied the functioning (upto an extent) of git-for-each-ref and
   git-udpate ref as it is required during the conversion of
   bisect_clean_state().

 * The main part (I think) was that I read about the method's which handled the
   refs. It was an interesting read though I did not read upon the actual
   implementations of those, I mainly covered "What does the method do?" and
   "How to use the method in my code?". git-grep is my best friend for this.

 * I am still quite amazed by the amount of attention refs receive. Christian
   explained a bit though I still don't get the feel why they are *sooo*
   important. I was recently reading the Git Rev News and also seeing the
   patches by Michael Haggerty and David Turner and I was quite amazed on
   the amount of attention refs get.

 * I also noticed a minor thing with bisect cleanups[6]. After the bisection
   state is cleaned up the folder "refs/bisect/" is not removed. I pointed
   this out but Christian thought it is okay the way it is.

 * When I was converting the function write_terms() Christian advised to use
   `|| exit` when calling it with a subcommand using `git bisect--helper
    --write-terms $TERM_BAD bad` but it got the test no. 43 and 44 failing in
    t6030. On a little bit investigation by Christian, these tests seem to
    fail when there is a bare repo. He asked me to investigate it further.
    I have currently not found enough time. Will do it in the coming week.


================================= NEXT STEPS ================================
Things which would be done in the coming week:

 * Finish bisect_clean_state() conversion. I will first put it up on github
   to receive comments from my mentors and then post it to the mailing list.

 * Convert the function bisect_head(). I plan to convert this function and add
   it as a subcommand to test the implementation but I will only send the
   function without the subcommand to the mailing list because its a too small
   function. Though the subcommand version will be put up on github for
   everyone to verify whether it is passing the test suite like I have done it
   for bisect_voc().

 * Convert the function bisect_write(). I plan to convert this function and
   add it as a subcommand.

 * Investigate why test no. 43 and 44 are failing in t6030 with `|| exit` in
   --write-terms.


================================ NOTIFICATION ==============================

I will be taking a short vacation from 16th May, 2016 to 19th May, 2016 so
I wouldn't be available via email and also will not be able to work. I intend
to make up for the lost time by working on weekends.

[1]: https://github.com/pranitbauva1997/git
[2]: http://thread.gmane.org/gmane.comp.version-control.git/294388
[3]: http://thread.gmane.org/gmane.comp.version-control.git/294571
[4]: https://github.com/pranitbauva1997/git/pull/6
[5]: http://thread.gmane.org/gmane.comp.version-control.git/294520
[6]: https://github.com/pranitbauva1997/git/pull/8

PS: Thanks to Andrew Ardill <[hidden email]> on providing his comments
of how to improve the format of this update email. I have tried to make it
as exhaustive as possible.

Regards,
Pranit Bauva
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC Update] Week 2

Matthieu Moy-2
Pranit Bauva <[hidden email]> writes:

> ================================= SUMMARY ==================================
> My micro project on adding config variable to git-commit for verbose options
> is going to be merged with the master branch soon and will be available for
> git 2.8.3 .

Nit: being merged to master doesn't mean you'll be in the next minor
release, but in the next _major_ one. 2.8.3 will only contain bugfixes
compared to 2.8.2.

--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC Update] Week 2

Junio C Hamano
In reply to this post by pranitbauva1997
Pranit Bauva <[hidden email]> writes:

>    is available for testing on the pu branch. I am encouraging people to
>    test it and provide useful comments.

Do not encourage people to "TEST".  In general, do not put too much
weight on testing.  The result would only measure a small portion of
what you wrote in the code, i.e. what you covered with the addition
to the test suite, plus whatever tests we already had.

Instead, ask people to review.  A new code passing the testsuite is
a minimum requirement, and that is far from sufficient.

>  * I have also converted bisect_log() and bisect_voc() whose patches[3] are
>    sent to the list. Junio is yet to pick these up.

Again, my picking them up is not a success criteria (and certainly
being on 'pu' does not count for anything--it is nothing more than
"Junio saw them on the list and bookmarked the messages".

You should worry more about people not commenting nor reviewing them
than me picking them up (which would typically come later).

>  * The main part (I think) was that I read about the method's which handled the
>    refs. It was an interesting read though I did not read upon the actual
>    implementations of those, I mainly covered "What does the method do?" and
>    "How to use the method in my code?". git-grep is my best friend for this.

Yup.

You would not be calling for-each-ref from a C rewrite of
bisect-clean-state.  Instead you would likely be calling
for_each_ref_in() to iterate over the existing refs/bisect/* refs,
recording their refname and objectname from the callback to
something like string_list, and then after for_each_ref_in()
finishes, iterate over the resulting string_list and running
delete_ref() on them.

And reading the implementation of for-each-ref and update-ref is a
good way to find the need to use these API calls and how they are
used.  API docs are your second step.

Overall, good progress for an early week.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC Update] Week 2

Junio C Hamano
In reply to this post by Matthieu Moy-2
Matthieu Moy <[hidden email]> writes:

> Pranit Bauva <[hidden email]> writes:
>
>> ================================= SUMMARY ==================================
>> My micro project on adding config variable to git-commit for verbose options
>> is going to be merged with the master branch soon and will be available for
>> git 2.8.3 .
>
> Nit: being merged to master doesn't mean you'll be in the next minor
> release, but in the next _major_ one. 2.8.3 will only contain bugfixes
> compared to 2.8.2.

Correct.

Recent "What's cooking" lists the topic as "Will merge to 'master'"
but this does not promise in which timeframe it will be merged to
'master', so it may not even be in 2.9.0 at all.

Generally, what is in 'next' is marked as "Will merge to 'master'"
by default, until a reason not to do so is found, at which time the
mark is changed to "Will hold", etc., so saying "master branch soon"
upon seeing "Will merge to 'master'" is a bit of overstatement.

In fact, "git log maint..pb/commit-verbse-config" shows that this
new feature is not ineligible for the maintenance track.  It will
never be in 2.8.3 or any 2.8.x series.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC Update] Week 2

pranitbauva1997
In reply to this post by Junio C Hamano
Hey Junio,

On Mon, May 16, 2016 at 12:41 AM, Junio C Hamano <[hidden email]> wrote:

> Pranit Bauva <[hidden email]> writes:
>
>>    is available for testing on the pu branch. I am encouraging people to
>>    test it and provide useful comments.
>
> Do not encourage people to "TEST".  In general, do not put too much
> weight on testing.  The result would only measure a small portion of
> what you wrote in the code, i.e. what you covered with the addition
> to the test suite, plus whatever tests we already had.
>
> Instead, ask people to review.  A new code passing the testsuite is
> a minimum requirement, and that is far from sufficient.

Okay. Will keep this in mind.

>>  * I have also converted bisect_log() and bisect_voc() whose patches[3] are
>>    sent to the list. Junio is yet to pick these up.
>
> Again, my picking them up is not a success criteria (and certainly
> being on 'pu' does not count for anything--it is nothing more than
> "Junio saw them on the list and bookmarked the messages".
>
> You should worry more about people not commenting nor reviewing them
> than me picking them up (which would typically come later).

Sure.

>>  * The main part (I think) was that I read about the method's which handled the
>>    refs. It was an interesting read though I did not read upon the actual
>>    implementations of those, I mainly covered "What does the method do?" and
>>    "How to use the method in my code?". git-grep is my best friend for this.
>
> Yup.
>
> You would not be calling for-each-ref from a C rewrite of
> bisect-clean-state.  Instead you would likely be calling
> for_each_ref_in() to iterate over the existing refs/bisect/* refs,
> recording their refname and objectname from the callback to
> something like string_list, and then after for_each_ref_in()
> finishes, iterate over the resulting string_list and running
> delete_ref() on them.

Actually I was seeing how for-each-ref called filter_ref() and
planning to use that. But for_each_ref_in() seems much better. Thanks.
I had planned on using delete_ref().

> And reading the implementation of for-each-ref and update-ref is a
> good way to find the need to use these API calls and how they are
> used.  API docs are your second step.

Thanks. I have read the man pages as well as some parts of the
implementation (not the core details). API docs contain little
information about ref handling though. I can try trying writing some
documentation after GSoC project once I am comfortable with ref
handling.

> Overall, good progress for an early week.

Thanks!

Regards,
Pranit Bauva

> Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

[GSoC Update] Week 3

pranitbauva1997
In reply to this post by pranitbauva1997
============================ INTRODUCTION ==============================
The purpose of this project is to convert the git-bisect utility which
partly exists in the form of shell scripts to C code so as to make it more
portable. I plan to do this by converting each function to C and then
calling it from git-bisect.sh so as to use the existing test suite to test
the function which is converted.

Mentors:
Christian Couder <[hidden email]>
Lars Schneider <[hidden email]>

============================== UPDATES =================================
Things which were done in this week:

 * My patches for write_terms()[1] and bisect_log()/voc()[2] have collected
   some reviews from Eric Sunshine and Johannes Schindelin.

 * As advised in the reviews I have mainly read about git_path() and other
   related functions from cache.h

 * Also read up on the refs stuff like for_each_ref_in() which Junio
   mentioned in the previous update email.

 * I have made 2 commits[3] which I am keeping on hold for now as they are
   followup for a commit made by Jeff King which I came across while
   reading about git_path() and related stuff.

 * I have kind of finished writing bisect_clean_state() function. But I
   am still working on that as I suspect there might be something missing.

============================ NEXT STEPS ================================
Since I wasn't able to cover up many things this week (which I had
initially planned), those things have now been carried forward along with
a few other stuff. I plan to work more this week and the coming few ones
to make up for the lost time.

Things which would be done in the coming week:

 * Finish off (finally) bisect_clean_state() conversion.

 * Convert the function bisect_head(). I plan to convert this function and
   add it as a subcommand to test the implementation but I will only send
   the function without the subcommand to the mailing list because its a
   too small function. Though the subcommand version will be put up on
   github for everyone to verify whether it is passing the test suite like
   I have done it for bisect_voc().

 * Convert the function bisect_write(). I plan to convert this function
   and add it as a subcommand.

 * Investigate why test no. 43 and 44 are failing in t6030 with `|| exit`
   in --write-terms.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/294388
[2]: http://thread.gmane.org/gmane.comp.version-control.git/294571
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html