* [GSOC/RFC] GSoC Proposal Draft | Git Beginner
@ 2016-03-20 16:34 Sidhant Sharma
2016-03-20 18:52 ` Matthieu Moy
0 siblings, 1 reply; 9+ messages in thread
From: Sidhant Sharma @ 2016-03-20 16:34 UTC (permalink / raw)
To: Lars Schneider
Cc: Git Mailing List, Junio C Hamano, philipoakley, Kevin Daudt,
Matthieu Moy, Jacob Keller
Hi,
I have drafted my proposal for the project 'Git Beginner', and would
like to request your suggestions on improving it. I'm also reading up the Git
documentation and the Git ProBook (again) to make notes for the beginner
documentation. Would be great to hear your comments on it.
Thanks and regards,
Sidhant Sharma
---
Implement a beginner mode for Git.
Abstract
Git is a very powerful version control system, with an array of features
that lend the user with great capabilities. But it often so happens that some
beginners are overwhelmed by its complexity and are unable to fully understand
and thus, utilize Git. Moreover, often beginners do not fully understand
the command they are using and end up making destructive (and occasionally,
irreversible) changes to the repository.
The beginner mode will assist such users in using Git by warning them
before making possibly destructive changes. It will also display tips and
short snippets of documentation for better understanding the Git model.
About Me
Name : Sidhant Sharma
Email [1] : Sidhant.Sharma1208 <at> gmail.com
Email [2] : Tigerkid001 <at> gmail.com
College : Delhi Technological University
Studying : Software Engineering
IRC : tk001 (or _tk_)
Phone : 91-9990-606-081
Country : India
Interests : Computers, Books, Photography
Github : Tigerkid001
LinkedIn : https://in.linkedin.com/in/sidhantsharma12
Technical Experience
Authored several Mozilla Firefox and Google Chrome extensions.
Developed a robust Plugin framework for Android for a startup. Learning Linux
kernel programming via the Eudyptula Challenge.
Developed natural language processor for sarcasm detection in tweets.
Developed gesture detection module as a college minor project.
Active Firefox Add-ons Editor at AMO (addons <dot> mozilla <dot> org).
Currently working on a restaurant image classification project as second college
minor project.
Why I chose Git
I have been using Git for about two years now, and it has become an
indispensable daily-use tool for me. Getting a chance to participate in GSoC
for the first time under Git is very exciting. It will give me an opportunity
to intimately know the system and a chance to help in making it better and more
powerful.
Proposal
Ideas Page: Git Beginner
The following tasks summarize the project:
Implement a wrapper around Git
A wrapper is to be implemented around (currently called 'ggit'), which will
provide the following user interface:
`ggit <git-command> <options>`
For example, `ggit add --all`
The wrapper will assess the arguments passed to it, and if they are detected to
be safe, it will simply pass them through to 'git'.
Warning for potentially destructive commands
For every command that is entered, the wrapper will assess the subcommand and
its options. In that, it will first check if the subcommand (eg. add,
commit, rebase) is present in a list of predefined 'potentially destructive'
commands. This can be done by searching through a radix tree for the subcommand.
If found, then the arguments to the subcommand will be checked for specific
flags. The graylisted flags for the destructive commands will be stored as an
array of regular expressions, and the current command's arguments will be
checked against them. If matches are found, a warning is displayed. 'ggit'
for the warning would be
"You are about to do X, which will permanently destroy Y. Are you sure you wish
to continue? [Y/n] "
If the user enters Y[es], the command will be executed as is (by passing it
unaltered to git). In the case of Y[es], 'ggit' will also give tips for undoing
the changes made by this command (by referring the user to correct commands and
reflog), if the command can be undone. In case the command cannot be undone,
'ggit' will display an additional line in the warning like
"The changes made by this command cannot be undone. Please proceed cautiously".
In the case of n[o], 'ggit' will exit without executing the command.
Usage tips and documentation
The wrapper will also be responsible for showing a short description of every
command that is entered through 'ggit'. This shall be done for every command
unconditionally. The description will be derived from the actual documentation,
but will primarily aim to help the beginner understand the Git workflow and the
Git model.
Timeline
Community Bonding Period
Week 1 : Discuss the flow of course with the mentor. Discuss adequate data
structures and search techniques to be used.
Week 2-3 : Discuss over an extensive list of commands that should be classified
as destructive. Discuss appropriate short descriptions for commands.
Week 4 : Discuss code structure, tests, optimization for least overhead and
other details.
Coding Starts
Week 1-2 : Submit code for a basic wrapper that will warn for a subset of the
potentially destructive command, and continue if the command is safe.
and this is stored as per to provide backward compatibility.
Week 3-6 : Extend the wrapper to warn for all commands in the list, along with
proper instructions for undoing them.
Mid Term Evaluation
Week 7-10 : Add beginner-friendly documentation snippets to various git commands.
Week 10-12 : Write tests, evaluate performance.
Week 13 : Final cleanup, final touches suggested by mentors and community.
Pens Down Date
Submission of Code to GSOC
Post GSoC 2016
After GSoC 2016 is over, I believe there will stilll be further work required
for improving and perfecting the 'ggit' interface before it can be merged with
the main distribution. I would like to continue my work on this project and
contribute to Git in general as well.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-20 16:34 [GSOC/RFC] GSoC Proposal Draft | Git Beginner Sidhant Sharma
@ 2016-03-20 18:52 ` Matthieu Moy
2016-03-21 7:40 ` Sidhant Sharma
2016-03-21 10:19 ` Sidhant Sharma
0 siblings, 2 replies; 9+ messages in thread
From: Matthieu Moy @ 2016-03-20 18:52 UTC (permalink / raw)
To: Sidhant Sharma
Cc: Lars Schneider, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
Sidhant Sharma <tigerkid001@gmail.com> writes:
> Implement a beginner mode for Git.
>
> Abstract
>
> Git is a very powerful version control system, with an array of features
> that lend the user with great capabilities. But it often so happens that some
> beginners are overwhelmed by its complexity and are unable to fully understand
> and thus, utilize Git. Moreover, often beginners do not fully understand
> the command they are using and end up making destructive (and occasionally,
> irreversible) changes to the repository.
>
> The beginner mode will assist such users in using Git by warning them
> before making possibly destructive changes. It will also display tips and
> short snippets of documentation for better understanding the Git model.
[...]
(Google summer of code Idea suggested here:
http://git.github.io/SoC-2016-Ideas/#git-beginner )
> A wrapper is to be implemented around (currently called 'ggit'), which will
> provide the following user interface:
> `ggit <git-command> <options>`
There's actually already a tool doing this:
https://people.gnome.org/~newren/eg/
I'm Cc-ing the author.
I heard good feedback about the tool in the early days of Git, when git
itself was rather clearly not ready for bare mortals. The tool seems
abandonned since 2013 (last release), my guess is that git became usable
enough and eg is not needed as much as it was. For example, eg defaulted
to push.default=tracking before we did the change to push.default=simple
in git.
I think the "wrapper" approach is sound. It avoids touching git itself
and breaking things that depend on git (for example, adding
core.denyHardReset to let "git reset --hard" error out would be
unacceptable because it would mean that any script using "git reset
--hard" would break when a user has the option set in ~/.gitconfig).
Note that it implies writting an almost full-blown option parser to
recognize commands like
ggit --work-tree git --namespace reset --git-dir --hard git log
(just looking for "git", "reset" and "--hard" in the command-line would
not work here).
Another option would be to have a C implementation of ggit that would
reuse the whole git source code, but set a flag "beginner_mode" to true
before starting, and then introduce "if (beginner_mode)" within Git's
source code. I think the wrapper approach is better since it avoids
"polluting" Git's source code itself.
> The wrapper will assess the arguments passed to it, and if they are detected to
> be safe, it will simply pass them through to 'git'.
>
> Warning for potentially destructive commands
>
> For every command that is entered, the wrapper will assess the subcommand and
> its options. In that, it will first check if the subcommand (eg. add,
> commit, rebase) is present in a list of predefined 'potentially destructive'
> commands. This can be done by searching through a radix tree for the subcommand.
> If found, then the arguments to the subcommand will be checked for specific
> flags. The graylisted flags for the destructive commands will be stored as an
> array of regular expressions, and the current command's arguments will be
> checked against them. If matches are found, a warning is displayed. 'ggit'
> for the warning would be
> "You are about to do X, which will permanently destroy Y. Are you sure you wish
> to continue? [Y/n] "
> If the user enters Y[es], the command will be executed as is (by passing it
> unaltered to git). In the case of Y[es], 'ggit' will also give tips for undoing
> the changes made by this command (by referring the user to correct commands and
> reflog), if the command can be undone. In case the command cannot be undone,
> 'ggit' will display an additional line in the warning like
> "The changes made by this command cannot be undone. Please proceed cautiously".
> In the case of n[o], 'ggit' will exit without executing the command.
> Usage tips and documentation
>
> The wrapper will also be responsible for showing a short description of every
> command that is entered through 'ggit'. This shall be done for every command
> unconditionally.
I'm not 100% convinced that this is a good idea: it'd be tempting for
the user to run a command just to know what it does. Perhaps it's better
to let the user run "git <command> -h" instead. But it could indeed help
for commands doing very different things depending on the options, like
$ git checkout foo
Checks-out branch foo
$ git checkout -b bar
Creating a new branch bar and checking it out
$ git checkout HEAD -- .
Reverting directory . to its last commited state
...
(I think a list of examples would be an important addition to your
proposal to clarify the plans)
> The description will be derived from the actual documentation, but
> will primarily aim to help the beginner understand the Git workflow
> and the Git model.
>
> Timeline
>
> Community Bonding Period
>
> Week 1 : Discuss the flow of course with the mentor. Discuss adequate data
> structures and search techniques to be used.
>
> Week 2-3 : Discuss over an extensive list of commands that should be classified
> as destructive. Discuss appropriate short descriptions for commands.
>
> Week 4 : Discuss code structure, tests, optimization for least overhead and
> other details.
>
> Coding Starts
>
> Week 1-2 : Submit code for a basic wrapper that will warn for a subset of the
> potentially destructive command, and continue if the command is safe.
> and this is stored as per to provide backward compatibility.
I think you can submit an RFC even earlier. Writting and discussing an
extensive list of commands before seeing any code might end up being
boring...
> Week 3-6 : Extend the wrapper to warn for all commands in the list, along with
> proper instructions for undoing them.
>
> Mid Term Evaluation
>
> Week 7-10 : Add beginner-friendly documentation snippets to various git commands.
>
> Week 10-12 : Write tests, evaluate performance.
You don't want to write tests at the end.
> Week 13 : Final cleanup, final touches suggested by mentors and community.
>
> Pens Down Date
> Submission of Code to GSOC
>
>
> Post GSoC 2016
> After GSoC 2016 is over, I believe there will stilll be further work required
> for improving and perfecting the 'ggit' interface before it can be merged with
> the main distribution.
I think having the wrapper merged in the main distribution before the
end of the GSoC must be a goal of the project. Sure, it can be improved
later, but code not merged at the end of a GSoC usually rests for months
or years, and is often lost forever.
> I would like to continue my work on this project and contribute to Git
> in general as well.
Cheers,
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-20 18:52 ` Matthieu Moy
@ 2016-03-21 7:40 ` Sidhant Sharma
2016-03-21 8:29 ` Matthieu Moy
2016-03-21 10:19 ` Sidhant Sharma
1 sibling, 1 reply; 9+ messages in thread
From: Sidhant Sharma @ 2016-03-21 7:40 UTC (permalink / raw)
To: Matthieu Moy
Cc: Lars Schneider, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
On Monday 21 March 2016 12:22 AM, Matthieu Moy wrote:
> Sidhant Sharma <tigerkid001@gmail.com> writes:
>
>> A wrapper is to be implemented around (currently called 'ggit'), which will
>> provide the following user interface:
>> `ggit <git-command> <options>`
> There's actually already a tool doing this:
>
> https://people.gnome.org/~newren/eg/
>
> I'm Cc-ing the author.
>
> I heard good feedback about the tool in the early days of Git, when git
> itself was rather clearly not ready for bare mortals. The tool seems
> abandonned since 2013 (last release), my guess is that git became usable
> enough and eg is not needed as much as it was. For example, eg defaulted
> to push.default=tracking before we did the change to push.default=simple
> in git.
Nice! I'll take a look at its source and see how it works.
>
> I think the "wrapper" approach is sound. It avoids touching git itself
> and breaking things that depend on git (for example, adding
> core.denyHardReset to let "git reset --hard" error out would be
> unacceptable because it would mean that any script using "git reset
> --hard" would break when a user has the option set in ~/.gitconfig).
>
> Note that it implies writting an almost full-blown option parser to
> recognize commands like
>
> ggit --work-tree git --namespace reset --git-dir --hard git log
>
> (just looking for "git", "reset" and "--hard" in the command-line would
> not work here).
Could you please elaborate on the above command, I'm unable to
understand its syntax. I thought all git commands follow the
`git command <arguments>` syntax, so using simple string
manipulations and regexes would work. Am I missing something?
>> The wrapper will assess the arguments passed to it, and if they are detected to
>> be safe, it will simply pass them through to 'git'.
>>
>> Warning for potentially destructive commands
>>
>> For every command that is entered, the wrapper will assess the subcommand and
>> its options. In that, it will first check if the subcommand (eg. add,
>> commit, rebase) is present in a list of predefined 'potentially destructive'
>> commands. This can be done by searching through a radix tree for the subcommand.
>> If found, then the arguments to the subcommand will be checked for specific
>> flags. The graylisted flags for the destructive commands will be stored as an
>> array of regular expressions, and the current command's arguments will be
>> checked against them. If matches are found, a warning is displayed. 'ggit'
>> for the warning would be
>> "You are about to do X, which will permanently destroy Y. Are you sure you wish
>> to continue? [Y/n] "
>> If the user enters Y[es], the command will be executed as is (by passing it
>> unaltered to git). In the case of Y[es], 'ggit' will also give tips for undoing
>> the changes made by this command (by referring the user to correct commands and
>> reflog), if the command can be undone. In case the command cannot be undone,
>> 'ggit' will display an additional line in the warning like
>> "The changes made by this command cannot be undone. Please proceed cautiously".
>> In the case of n[o], 'ggit' will exit without executing the command.
>> Usage tips and documentation
>>
>> The wrapper will also be responsible for showing a short description of every
>> command that is entered through 'ggit'. This shall be done for every command
>> unconditionally.
> I'm not 100% convinced that this is a good idea: it'd be tempting for
> the user to run a command just to know what it does. Perhaps it's better
> to let the user run "git <command> -h" instead. But it could indeed help
> for commands doing very different things depending on the options, like
>
> $ git checkout foo
> Checks-out branch foo
> $ git checkout -b bar
> Creating a new branch bar and checking it out
> $ git checkout HEAD -- .
> Reverting directory . to its last commited state
Yes, I did consider that and came up with this: I thought we can
have an option like --intro or --doc that will just print the
intro snippet for the command without actually running. Though
"git <command> -h" is an option, I wasn't inclined towards it as I
think sometimes the output from -h may not make sense to a new user.
Plus, -h only gives an elaborate list of syntax and options/arguments
but not say what the command does.
> ...
>
> (I think a list of examples would be an important addition to your
> proposal to clarify the plans)
Will do that.
>> The description will be derived from the actual documentation, but
>> will primarily aim to help the beginner understand the Git workflow
>> and the Git model.
>>
>> Timeline
>>
>> Community Bonding Period
>>
>> Week 1 : Discuss the flow of course with the mentor. Discuss adequate data
>> structures and search techniques to be used.
>>
>> Week 2-3 : Discuss over an extensive list of commands that should be classified
>> as destructive. Discuss appropriate short descriptions for commands.
>>
>> Week 4 : Discuss code structure, tests, optimization for least overhead and
>> other details.
>>
>> Coding Starts
>>
>> Week 1-2 : Submit code for a basic wrapper that will warn for a subset of the
>> potentially destructive command, and continue if the command is safe.
>> and this is stored as per to provide backward compatibility.
> I think you can submit an RFC even earlier. Writting and discussing an
> extensive list of commands before seeing any code might end up being
> boring...
I wasn't sure if we are allowed to code before the actual coding period begins
so I kept it that way. I'll update it now.
>> Week 3-6 : Extend the wrapper to warn for all commands in the list, along with
>> proper instructions for undoing them.
>>
>> Mid Term Evaluation
>>
>> Week 7-10 : Add beginner-friendly documentation snippets to various git commands.
>>
>> Week 10-12 : Write tests, evaluate performance.
> You don't want to write tests at the end.
>
Alright, I'll put writing tests into their respective time frames.
>> Week 13 : Final cleanup, final touches suggested by mentors and community.
>>
>> Pens Down Date
>> Submission of Code to GSOC
>>
>>
>> Post GSoC 2016
>> After GSoC 2016 is over, I believe there will stilll be further work required
>> for improving and perfecting the 'ggit' interface before it can be merged with
>> the main distribution.
> I think having the wrapper merged in the main distribution before the
> end of the GSoC must be a goal of the project. Sure, it can be improved
> later, but code not merged at the end of a GSoC usually rests for months
> or years, and is often lost forever.
OK, so I guess that section can be removed altogether since it's not
relevant to the project otherwise.
>> I would like to continue my work on this project and contribute to Git
>> in general as well.
> Cheers,
Thanks and regards,
Sidhant
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-21 7:40 ` Sidhant Sharma
@ 2016-03-21 8:29 ` Matthieu Moy
2016-03-21 10:10 ` Sidhant Sharma
0 siblings, 1 reply; 9+ messages in thread
From: Matthieu Moy @ 2016-03-21 8:29 UTC (permalink / raw)
To: Sidhant Sharma
Cc: Lars Schneider, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
Sidhant Sharma <tigerkid001@gmail.com> writes:
> On Monday 21 March 2016 12:22 AM, Matthieu Moy wrote:
>
>> Note that it implies writting an almost full-blown option parser to
>> recognize commands like
>>
>> ggit --work-tree git --namespace reset --git-dir --hard git log
>>
>> (just looking for "git", "reset" and "--hard" in the command-line would
>> not work here).
>
> Could you please elaborate on the above command, I'm unable to
> understand its syntax. I thought all git commands follow the
> `git command <arguments>` syntax, so using simple string
> manipulations and regexes would work. Am I missing something?
The full syntax is
git [global options] <command> [options and arguments for a command]
For example:
git -p log => -p is the option for "git" itself, which means "paginate"
git log -p => -p is the option for "git log", which means "patch"
Options can have stuck or non-stuck form, for example
git --work-tree=foo <=> git --work-tree foo
git --work-tree git --namespace reset --git-dir --hard git log
<=>
git --work-tree=git --namespace=reset --git-dir=--hard git log
(This is probably a stupid command to type, but it's legal)
The later is source of issues for a parser since you can't just iterate
through argv[] and search for problematic commands/options, since you
have to distinguish options themselves (--work-tree above) and option
arguments (foo above).
In my example above, I played with global options (before "git" in the
command-line), but I could also have done that with per-command options
taking arguments, like
git push --repo --force
Here, --force is the name of the repo (again, probably a stupid name,
but why not), not the --force option.
> I wasn't sure if we are allowed to code before the actual coding period begins
> so I kept it that way. I'll update it now.
You're not "forced" to, but you can write code whenever you like. We've
already seen code written before the application!
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-21 8:29 ` Matthieu Moy
@ 2016-03-21 10:10 ` Sidhant Sharma
0 siblings, 0 replies; 9+ messages in thread
From: Sidhant Sharma @ 2016-03-21 10:10 UTC (permalink / raw)
To: Matthieu Moy
Cc: Lars Schneider, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
On Monday 21 March 2016 01:59 PM, Matthieu Moy wrote:
> Sidhant Sharma <tigerkid001@gmail.com> writes:
>
>> On Monday 21 March 2016 12:22 AM, Matthieu Moy wrote:
>>
>>> Note that it implies writting an almost full-blown option parser to
>>> recognize commands like
>>>
>>> ggit --work-tree git --namespace reset --git-dir --hard git log
>>>
>>> (just looking for "git", "reset" and "--hard" in the command-line would
>>> not work here).
>> Could you please elaborate on the above command, I'm unable to
>> understand its syntax. I thought all git commands follow the
>> `git command <arguments>` syntax, so using simple string
>> manipulations and regexes would work. Am I missing something?
> The full syntax is
>
> git [global options] <command> [options and arguments for a command]
>
> For example:
>
> git -p log => -p is the option for "git" itself, which means "paginate"
> git log -p => -p is the option for "git log", which means "patch"
>
> Options can have stuck or non-stuck form, for example
>
> git --work-tree=foo <=> git --work-tree foo
>
> git --work-tree git --namespace reset --git-dir --hard git log
> <=>
> git --work-tree=git --namespace=reset --git-dir=--hard git log
>
> (This is probably a stupid command to type, but it's legal)
>
> The later is source of issues for a parser since you can't just iterate
> through argv[] and search for problematic commands/options, since you
> have to distinguish options themselves (--work-tree above) and option
> arguments (foo above).
Thanks for the explanation; I knew of the global options but didn't know
that the last command would be syntactically legal. For commands like such
iterating over argv[] wouldn't work (not in all cases). Though a beginner
may not enter commands of this sort, I agree we shouldn't rely on that. If
it were only for stuck commands, regexes would've worked.
I can now see why a parser would be needed here, which can recognize global
options and the above command syntax. But for this example,
> In my example above, I played with global options (before "git" in the
> command-line), but I could also have done that with per-command options
> taking arguments, like
>
> git push --repo --force
>
> Here, --force is the name of the repo (again, probably a stupid name,
> but why not), not the --force option.
would the parser also be required to understand all options and arguments for
all git commands? Although --force could not be a branch name (git denies it),
but it may not be so for other commands.
>> I wasn't sure if we are allowed to code before the actual coding period begins
>> so I kept it that way. I'll update it now.
> You're not "forced" to, but you can write code whenever you like. We've
> already seen code written before the application!
>
Nice! I too would like to get started early :)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-20 18:52 ` Matthieu Moy
2016-03-21 7:40 ` Sidhant Sharma
@ 2016-03-21 10:19 ` Sidhant Sharma
2016-03-22 8:38 ` Lars Schneider
1 sibling, 1 reply; 9+ messages in thread
From: Sidhant Sharma @ 2016-03-21 10:19 UTC (permalink / raw)
To: Matthieu Moy
Cc: Lars Schneider, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
Hi,
I updated the draft with links, ggit usage examples and some changes to the
timeline. I placed the links with reference here, but in the Google Doc, they're
inline.
Thanks and regards,
Sidhant Sharma
---
Implement a beginner mode for Git.
Abstract
Git is a very powerful version control system, with an array of features
that lend the user with great capabilities. But it often so happens that some
beginners are overwhelmed by its complexity and are unable to fully understand
and thus, utilize Git. Moreover, often beginners do not fully understand
the command they are using and end up making destructive (and occasionally,
irreversible) changes to the repository.
The beginner mode will assist such users in using Git by warning them
before making possibly destructive changes. It will also display tips and
short snippets of documentation for better understanding the Git model.
Google summer of code Idea suggested here:
http://git.github.io/SoC-2016-Ideas/#git-beginner
About Me
Name : Sidhant Sharma
Email [1] : Sidhant.Sharma1208 <at> gmail.com
Email [2] : Tigerkid001 <at> gmail.com
College : Delhi Technological University
Studying : Software Engineering
IRC : tk001 (or _tk_)
Phone : 91-9990-606-081
Country : India
Interests : Computers, Books, Photography
Github : Tigerkid001
LinkedIn : https://in.linkedin.com/in/sidhantsharma12
Technical Experience
Authored several Mozilla Firefox and Google Chrome extensions:
Firefox: Owl [1], Blink [2], Spoiler Jedi [3]
Chrome: Blink [4]
Developed a robust Plugin framework for Android [5] for a startup.
Learning Linux kernel programming via the Eudyptula Challenge [6]
(currently level 6).
Developed natural language processor for sarcasm detection [7] in tweets.
Developed hand gesture detection module [8] as a college minor project.
Active Firefox Add-ons Editor at AMO [9].
Currently working on a restaurant image classification project as second college
minor project.
Why I chose Git
I have been using Git for about two years now, and it has become an
indispensable daily-use tool for me. Getting a chance to participate in GSoC
for the first time under Git is very exciting. It will give me an opportunity
to intimately know the system and a chance to help in making it better and more
powerful.
Proposal
Ideas Page: Git Beginner [10]
The following tasks summarize the project:
Implement a wrapper around Git
A wrapper is to be implemented around (currently called 'ggit'), which will
provide the following user interface:
`ggit <git-command> <options>`
For example, `ggit add --all`
The wrapper will assess the arguments passed to it, and if they are detected to
be safe, it will simply pass them through to 'git'. This approach is favorable as the existing
users of git will not be affected by the wrapper.
Warning for potentially destructive commands
For every command that is entered, the wrapper will assess the subcommand and
its options. In that, it will first check if the subcommand (eg. add,
commit, rebase) is present in a list of predefined 'potentially destructive'
commands. This can be done by searching through a radix tree for the subcommand.
If found, then the arguments to the subcommand will be checked for specific
flags. The graylisted flags for the destructive commands will be stored as an
array of regular expressions, and the current command's arguments will be
checked against them. If matches are found, a warning is displayed. 'ggit'
for the warning would be
"You are about to do X, which will permanently destroy Y. Are you sure you wish
to continue? [Y/n] "
If the user enters Y[es], the command will be executed as is (by passing it
unaltered to git). In the case of Y[es], 'ggit' will also give tips for undoing
the changes made by this command (by referring the user to correct commands and
reflog), if the command can be undone. In case the command cannot be undone,
'ggit' will display an additional line in the warning like
"The changes made by this command cannot be undone. Please proceed cautiously".
In the case of n[o], 'ggit' will exit without executing the command.
Currently, the list consists of commands like:
$ git rebase
$ git reset --hard
$ git clean -f
$ git gc --prune=now --aggressive
$ git push -f <branch>
$ git push remote [+/:]<branch>
$ git branch -D
The list will be updated after some more discussion on the list.
Usage tips and documentation
The wrapper will also be responsible for showing a short description of every
command that is entered through 'ggit'. This shall be done for every command
unconditionally. The description will be derived from the actual documentation,
but will primarily aim to help the beginner understand the Git workflow and the
Git model.
A few examples to illustrate the working of the wrapper are:
$ ggit add --all
Staging all changes and untracked files. Use ` [g]git commit` to commit the changes.
$ ggit commit -m “Second commit”
Committing staged changes…
[master 0be3142] Second commit
4 files changed, 6 insertions(+), 2 deletions(-)
$ ggit reset HEAD~1 --hard
Resetting HEAD to 1 previous commit.
[WARNING] You are about to hard reset the current HEAD (master) by 1 commit.
This will take you back to commit b16aae3, and discard all changes make thereafter.
If you want to reset but also want to retain the changes made since, use --soft instead
of --hard.
Are you sure you want to continue? [Y/n] y
Resetting HEAD to b16aae3…
You can undo this action by resetting the HEAD to last commit you were on, which
can be seen by running `git reflog`.
HEAD is now at b16aae3 First commit
$ ggit push --force origin master
Pushing changes to origin/master
[WARNING] You are about to force push your history to origin/master, which will
rewrite the remote history. Please ensure you really want to do so.
Are you sure you want to continue? [Y/n] n
Aborting push to origin/master
Timeline
Community Bonding Period
Week 1 : Discuss the flow of course with the mentor. Discuss adequate data
structures and search techniques to be used.
Week 2-3 : Discuss over an extensive list of commands that should be classified
as destructive. Discuss appropriate short descriptions for commands. Submit sample
patches for the same for comments and review.
Week 4 : Discuss code structure, tests, optimization for least overhead and
other details.
Coding Starts
Week 1-2 : Submit code for a basic wrapper that will warn for a subset of the
potentially destructive command, and continue if the command is safe.
and this is stored as per to provide backward compatibility.
Week 3-5 : Extend the wrapper to warn for more commands in the list, along with
proper instructions for undoing them. Write tests for the commands supported so far.
Mid Term Evaluation
Week 6-7 : Complete support for all graylisted commands with tests.
Week 8-12: Add beginner-friendly documentation snippets to various git commands.
Week 13 : Final cleanup, final touches suggested by mentors and community.
Pens Down Date
Submission of Code to GSOC
[1]: https://addons.mozilla.org/en-US/firefox/addon/owl/
[2]: https://addons.mozilla.org/en-US/firefox/addon/blink/
[3]: https://addons.mozilla.org/en-US/firefox/addon/spoiler-jedi/
[4]: https://chrome.google.com/webstore/detail/blink-new-tab/kakaolkgegapcgdjdmlmcigejblohpkh/
[5]: https://github.com/TigerKid001/flubbr
[6]: http://eudyptula-challenge.org/
[7]: https://github.com/TigerKid001/Perry
[8]: https://github.com/TigerKid001/Dex
[9]: https://addons.mozilla.org/en-US/firefox/
[10]: http://git.github.io/SoC-2016-Ideas/#git-beginner
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-21 10:19 ` Sidhant Sharma
@ 2016-03-22 8:38 ` Lars Schneider
2016-03-22 9:05 ` Sidhant Sharma
2016-03-22 9:43 ` Sidhant Sharma
0 siblings, 2 replies; 9+ messages in thread
From: Lars Schneider @ 2016-03-22 8:38 UTC (permalink / raw)
To: Sidhant Sharma
Cc: Matthieu Moy, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
On 21 Mar 2016, at 11:19, Sidhant Sharma <tigerkid001@gmail.com> wrote:
> Hi,
> I updated the draft with links, ggit usage examples and some changes to the
> timeline. I placed the links with reference here, but in the Google Doc, they're
> inline.
>
> Thanks and regards,
> Sidhant Sharma
>
> ---
>
> Implement a beginner mode for Git.
>
> Abstract
>
> Git is a very powerful version control system, with an array of features
> that lend the user with great capabilities. But it often so happens that some
> beginners are overwhelmed by its complexity and are unable to fully understand
> and thus, utilize Git. Moreover, often beginners do not fully understand
> the command they are using and end up making destructive (and occasionally,
> irreversible) changes to the repository.
>
> The beginner mode will assist such users in using Git by warning them
> before making possibly destructive changes. It will also display tips and
> short snippets of documentation for better understanding the Git model.
>
> Google summer of code Idea suggested here:
> http://git.github.io/SoC-2016-Ideas/#git-beginner
>
> About Me
>
> Name : Sidhant Sharma
> Email [1] : Sidhant.Sharma1208 <at> gmail.com
> Email [2] : Tigerkid001 <at> gmail.com
> College : Delhi Technological University
> Studying : Software Engineering
> IRC : tk001 (or _tk_)
> Phone : 91-9990-606-081
> Country : India
> Interests : Computers, Books, Photography
> Github : Tigerkid001
> LinkedIn : https://in.linkedin.com/in/sidhantsharma12
>
> Technical Experience
>
> Authored several Mozilla Firefox and Google Chrome extensions:
> Firefox: Owl [1], Blink [2], Spoiler Jedi [3]
> Chrome: Blink [4]
>
> Developed a robust Plugin framework for Android [5] for a startup.
> Learning Linux kernel programming via the Eudyptula Challenge [6]
> (currently level 6).
> Developed natural language processor for sarcasm detection [7] in tweets.
> Developed hand gesture detection module [8] as a college minor project.
> Active Firefox Add-ons Editor at AMO [9].
> Currently working on a restaurant image classification project as second college
> minor project.
>
> Why I chose Git
>
> I have been using Git for about two years now, and it has become an
> indispensable daily-use tool for me. Getting a chance to participate in GSoC
> for the first time under Git is very exciting. It will give me an opportunity
> to intimately know the system and a chance to help in making it better and more
> powerful.
>
> Proposal
>
> Ideas Page: Git Beginner [10]
>
> The following tasks summarize the project:
>
> Implement a wrapper around Git
>
> A wrapper is to be implemented around (currently called 'ggit'), which will
> provide the following user interface:
> `ggit <git-command> <options>`
> For example, `ggit add --all`
> The wrapper will assess the arguments passed to it, and if they are detected to
> be safe, it will simply pass them through to 'git'. This approach is favorable as the existing
> users of git will not be affected by the wrapper.
>
> Warning for potentially destructive commands
>
> For every command that is entered, the wrapper will assess the subcommand and
> its options. In that, it will first check if the subcommand (eg. add,
> commit, rebase) is present in a list of predefined 'potentially destructive'
> commands. This can be done by searching through a radix tree for the subcommand.
> If found, then the arguments to the subcommand will be checked for specific
> flags. The graylisted flags for the destructive commands will be stored as an
> array of regular expressions, and the current command's arguments will be
> checked against them. If matches are found, a warning is displayed. 'ggit'
> for the warning would be
> "You are about to do X, which will permanently destroy Y. Are you sure you wish
> to continue? [Y/n] "
> If the user enters Y[es], the command will be executed as is (by passing it
> unaltered to git). In the case of Y[es], 'ggit' will also give tips for undoing
> the changes made by this command (by referring the user to correct commands and
> reflog), if the command can be undone. In case the command cannot be undone,
> 'ggit' will display an additional line in the warning like
> "The changes made by this command cannot be undone. Please proceed cautiously".
> In the case of n[o], 'ggit' will exit without executing the command.
>
> Currently, the list consists of commands like:
>
> $ git rebase
> $ git reset --hard
> $ git clean -f
> $ git gc --prune=now --aggressive
> $ git push -f <branch>
> $ git push remote [+/:]<branch>
> $ git branch -D
>
> The list will be updated after some more discussion on the list.
>
> Usage tips and documentation
>
> The wrapper will also be responsible for showing a short description of every
> command that is entered through 'ggit'. This shall be done for every command
> unconditionally. The description will be derived from the actual documentation,
> but will primarily aim to help the beginner understand the Git workflow and the
> Git model.
>
> A few examples to illustrate the working of the wrapper are:
>
> $ ggit add --all
> Staging all changes and untracked files. Use ` [g]git commit` to commit the changes.
>
> $ ggit commit -m “Second commit”
> Committing staged changes…
> [master 0be3142] Second commit
> 4 files changed, 6 insertions(+), 2 deletions(-)
>
> $ ggit reset HEAD~1 --hard
> Resetting HEAD to 1 previous commit.
> [WARNING] You are about to hard reset the current HEAD (master) by 1 commit.
> This will take you back to commit b16aae3, and discard all changes make thereafter.
> If you want to reset but also want to retain the changes made since, use --soft instead
> of --hard.
> Are you sure you want to continue? [Y/n] y
> Resetting HEAD to b16aae3…
> You can undo this action by resetting the HEAD to last commit you were on, which
> can be seen by running `git reflog`.
ggit could know the HEAD commit here. Therefore you could suggest 'git reset --hard $HASH_OF_OLD_HEAD'
in addition (I like the reference to reflog to teach users where to look for this info).
> HEAD is now at b16aae3 First commit
>
> $ ggit push --force origin master
> Pushing changes to origin/master
> [WARNING] You are about to force push your history to origin/master, which will
> rewrite the remote history. Please ensure you really want to do so.
I think the hardest challenge of this project is to find short and easy
explanations that a newbie with almost no prior Git knowledge understands.
We don't want to duplicate the man pages here. I have the impression visual
explanations can often be superior.
[WARNING] You are about to purge commits from the <URL of origin> master branch.
State right now:
o---o---o---A---B master on <URL of origin>
\
X---Y---Z your master
State if you continue:
o---o---o---X---Y---Z master on <URL of origin> and your master
Commit A and B will be gone. If other people have worked on top of A or B then
they won't be able to merge their changes easily.
As a bonus we could also check if the force push would actually do harm before
showing the message (that means if 'git push --force' was necessary at all or
if 'git push' would have done the same).
Thanks,
Lars
> Are you sure you want to continue? [Y/n] n
> Aborting push to origin/master
>
> Timeline
>
> Community Bonding Period
>
> Week 1 : Discuss the flow of course with the mentor. Discuss adequate data
> structures and search techniques to be used.
>
> Week 2-3 : Discuss over an extensive list of commands that should be classified
> as destructive. Discuss appropriate short descriptions for commands. Submit sample
> patches for the same for comments and review.
>
> Week 4 : Discuss code structure, tests, optimization for least overhead and
> other details.
>
> Coding Starts
>
> Week 1-2 : Submit code for a basic wrapper that will warn for a subset of the
> potentially destructive command, and continue if the command is safe.
> and this is stored as per to provide backward compatibility.
>
> Week 3-5 : Extend the wrapper to warn for more commands in the list, along with
> proper instructions for undoing them. Write tests for the commands supported so far.
>
> Mid Term Evaluation
>
> Week 6-7 : Complete support for all graylisted commands with tests.
>
> Week 8-12: Add beginner-friendly documentation snippets to various git commands.
>
> Week 13 : Final cleanup, final touches suggested by mentors and community.
>
> Pens Down Date
> Submission of Code to GSOC
>
> [1]: https://addons.mozilla.org/en-US/firefox/addon/owl/
> [2]: https://addons.mozilla.org/en-US/firefox/addon/blink/
> [3]: https://addons.mozilla.org/en-US/firefox/addon/spoiler-jedi/
> [4]: https://chrome.google.com/webstore/detail/blink-new-tab/kakaolkgegapcgdjdmlmcigejblohpkh/
> [5]: https://github.com/TigerKid001/flubbr
> [6]: http://eudyptula-challenge.org/
> [7]: https://github.com/TigerKid001/Perry
> [8]: https://github.com/TigerKid001/Dex
> [9]: https://addons.mozilla.org/en-US/firefox/
> [10]: http://git.github.io/SoC-2016-Ideas/#git-beginner
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-22 8:38 ` Lars Schneider
@ 2016-03-22 9:05 ` Sidhant Sharma
2016-03-22 9:43 ` Sidhant Sharma
1 sibling, 0 replies; 9+ messages in thread
From: Sidhant Sharma @ 2016-03-22 9:05 UTC (permalink / raw)
To: Lars Schneider
Cc: Matthieu Moy, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
On Tuesday 22 March 2016 02:08 PM, Lars Schneider wrote:
> On 21 Mar 2016, at 11:19, Sidhant Sharma <tigerkid001@gmail.com> wrote:
>
>> Hi,
>> I updated the draft with links, ggit usage examples and some changes to the
>> timeline. I placed the links with reference here, but in the Google Doc, they're
>> inline.
>>
>> Thanks and regards,
>> Sidhant Sharma
>>
>> ---
>>
>> Implement a beginner mode for Git.
>>
>> Abstract
>>
>> Git is a very powerful version control system, with an array of features
>> that lend the user with great capabilities. But it often so happens that some
>> beginners are overwhelmed by its complexity and are unable to fully understand
>> and thus, utilize Git. Moreover, often beginners do not fully understand
>> the command they are using and end up making destructive (and occasionally,
>> irreversible) changes to the repository.
>>
>> The beginner mode will assist such users in using Git by warning them
>> before making possibly destructive changes. It will also display tips and
>> short snippets of documentation for better understanding the Git model.
>>
>> Google summer of code Idea suggested here:
>> http://git.github.io/SoC-2016-Ideas/#git-beginner
>>
>> About Me
>>
>> Name : Sidhant Sharma
>> Email [1] : Sidhant.Sharma1208 <at> gmail.com
>> Email [2] : Tigerkid001 <at> gmail.com
>> College : Delhi Technological University
>> Studying : Software Engineering
>> IRC : tk001 (or _tk_)
>> Phone : 91-9990-606-081
>> Country : India
>> Interests : Computers, Books, Photography
>> Github : Tigerkid001
>> LinkedIn : https://in.linkedin.com/in/sidhantsharma12
>>
>> Technical Experience
>>
>> Authored several Mozilla Firefox and Google Chrome extensions:
>> Firefox: Owl [1], Blink [2], Spoiler Jedi [3]
>> Chrome: Blink [4]
>>
>> Developed a robust Plugin framework for Android [5] for a startup.
>> Learning Linux kernel programming via the Eudyptula Challenge [6]
>> (currently level 6).
>> Developed natural language processor for sarcasm detection [7] in tweets.
>> Developed hand gesture detection module [8] as a college minor project.
>> Active Firefox Add-ons Editor at AMO [9].
>> Currently working on a restaurant image classification project as second college
>> minor project.
>>
>> Why I chose Git
>>
>> I have been using Git for about two years now, and it has become an
>> indispensable daily-use tool for me. Getting a chance to participate in GSoC
>> for the first time under Git is very exciting. It will give me an opportunity
>> to intimately know the system and a chance to help in making it better and more
>> powerful.
>>
>> Proposal
>>
>> Ideas Page: Git Beginner [10]
>>
>> The following tasks summarize the project:
>>
>> Implement a wrapper around Git
>>
>> A wrapper is to be implemented around (currently called 'ggit'), which will
>> provide the following user interface:
>> `ggit <git-command> <options>`
>> For example, `ggit add --all`
>> The wrapper will assess the arguments passed to it, and if they are detected to
>> be safe, it will simply pass them through to 'git'. This approach is favorable as the existing
>> users of git will not be affected by the wrapper.
>>
>> Warning for potentially destructive commands
>>
>> For every command that is entered, the wrapper will assess the subcommand and
>> its options. In that, it will first check if the subcommand (eg. add,
>> commit, rebase) is present in a list of predefined 'potentially destructive'
>> commands. This can be done by searching through a radix tree for the subcommand.
>> If found, then the arguments to the subcommand will be checked for specific
>> flags. The graylisted flags for the destructive commands will be stored as an
>> array of regular expressions, and the current command's arguments will be
>> checked against them. If matches are found, a warning is displayed. 'ggit'
>> for the warning would be
>> "You are about to do X, which will permanently destroy Y. Are you sure you wish
>> to continue? [Y/n] "
>> If the user enters Y[es], the command will be executed as is (by passing it
>> unaltered to git). In the case of Y[es], 'ggit' will also give tips for undoing
>> the changes made by this command (by referring the user to correct commands and
>> reflog), if the command can be undone. In case the command cannot be undone,
>> 'ggit' will display an additional line in the warning like
>> "The changes made by this command cannot be undone. Please proceed cautiously".
>> In the case of n[o], 'ggit' will exit without executing the command.
>>
>> Currently, the list consists of commands like:
>>
>> $ git rebase
>> $ git reset --hard
>> $ git clean -f
>> $ git gc --prune=now --aggressive
>> $ git push -f <branch>
>> $ git push remote [+/:]<branch>
>> $ git branch -D
>>
>> The list will be updated after some more discussion on the list.
>>
>> Usage tips and documentation
>>
>> The wrapper will also be responsible for showing a short description of every
>> command that is entered through 'ggit'. This shall be done for every command
>> unconditionally. The description will be derived from the actual documentation,
>> but will primarily aim to help the beginner understand the Git workflow and the
>> Git model.
>>
>> A few examples to illustrate the working of the wrapper are:
>>
>> $ ggit add --all
>> Staging all changes and untracked files. Use ` [g]git commit` to commit the changes.
>>
>> $ ggit commit -m “Second commit”
>> Committing staged changes…
>> [master 0be3142] Second commit
>> 4 files changed, 6 insertions(+), 2 deletions(-)
>>
>> $ ggit reset HEAD~1 --hard
>> Resetting HEAD to 1 previous commit.
>> [WARNING] You are about to hard reset the current HEAD (master) by 1 commit.
>> This will take you back to commit b16aae3, and discard all changes make thereafter.
>> If you want to reset but also want to retain the changes made since, use --soft instead
>> of --hard.
>> Are you sure you want to continue? [Y/n] y
>> Resetting HEAD to b16aae3…
>> You can undo this action by resetting the HEAD to last commit you were on, which
>> can be seen by running `git reflog`.
> ggit could know the HEAD commit here. Therefore you could suggest 'git reset --hard $HASH_OF_OLD_HEAD'
> in addition (I like the reference to reflog to teach users where to look for this info).
>
Yeah, we can put that along with the reference to reflog so it's easier for users
to undo quickly. Will update the proposal.
>> HEAD is now at b16aae3 First commit
>>
>> $ ggit push --force origin master
>> Pushing changes to origin/master
>> [WARNING] You are about to force push your history to origin/master, which will
>> rewrite the remote history. Please ensure you really want to do so.
> I think the hardest challenge of this project is to find short and easy
> explanations that a newbie with almost no prior Git knowledge understands.
> We don't want to duplicate the man pages here. I have the impression visual
> explanations can often be superior.
>
>
> [WARNING] You are about to purge commits from the <URL of origin> master branch.
>
> State right now:
> o---o---o---A---B master on <URL of origin>
> \
> X---Y---Z your master
>
> State if you continue:
> o---o---o---X---Y---Z master on <URL of origin> and your master
>
> Commit A and B will be gone. If other people have worked on top of A or B then
> they won't be able to merge their changes easily.
I totally agree that visuals would serve the purpose much better. I'll
update the example with the warning message you suggest, and get started
with preparing more such visual descriptions. I'll post them for RFC soon.
> As a bonus we could also check if the force push would actually do harm before
> showing the message (that means if 'git push --force' was necessary at all or
> if 'git push' would have done the same).
That'll be a nice touch. Will keep that in mind.
Thanks and regards,
Sidhant Sharma
>
> Thanks,
> Lars
>
>
>
>> Are you sure you want to continue? [Y/n] n
>> Aborting push to origin/master
>>
>> Timeline
>>
>> Community Bonding Period
>>
>> Week 1 : Discuss the flow of course with the mentor. Discuss adequate data
>> structures and search techniques to be used.
>>
>> Week 2-3 : Discuss over an extensive list of commands that should be classified
>> as destructive. Discuss appropriate short descriptions for commands. Submit sample
>> patches for the same for comments and review.
>>
>> Week 4 : Discuss code structure, tests, optimization for least overhead and
>> other details.
>>
>> Coding Starts
>>
>> Week 1-2 : Submit code for a basic wrapper that will warn for a subset of the
>> potentially destructive command, and continue if the command is safe.
>> and this is stored as per to provide backward compatibility.
>>
>> Week 3-5 : Extend the wrapper to warn for more commands in the list, along with
>> proper instructions for undoing them. Write tests for the commands supported so far.
>>
>> Mid Term Evaluation
>>
>> Week 6-7 : Complete support for all graylisted commands with tests.
>>
>> Week 8-12: Add beginner-friendly documentation snippets to various git commands.
>>
>> Week 13 : Final cleanup, final touches suggested by mentors and community.
>>
>> Pens Down Date
>> Submission of Code to GSOC
>>
>> [1]: https://addons.mozilla.org/en-US/firefox/addon/owl/
>> [2]: https://addons.mozilla.org/en-US/firefox/addon/blink/
>> [3]: https://addons.mozilla.org/en-US/firefox/addon/spoiler-jedi/
>> [4]: https://chrome.google.com/webstore/detail/blink-new-tab/kakaolkgegapcgdjdmlmcigejblohpkh/
>> [5]: https://github.com/TigerKid001/flubbr
>> [6]: http://eudyptula-challenge.org/
>> [7]: https://github.com/TigerKid001/Perry
>> [8]: https://github.com/TigerKid001/Dex
>> [9]: https://addons.mozilla.org/en-US/firefox/
>> [10]: http://git.github.io/SoC-2016-Ideas/#git-beginner
>>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [GSOC/RFC] GSoC Proposal Draft | Git Beginner
2016-03-22 8:38 ` Lars Schneider
2016-03-22 9:05 ` Sidhant Sharma
@ 2016-03-22 9:43 ` Sidhant Sharma
1 sibling, 0 replies; 9+ messages in thread
From: Sidhant Sharma @ 2016-03-22 9:43 UTC (permalink / raw)
To: Lars Schneider
Cc: Matthieu Moy, Git Mailing List, Junio C Hamano, philipoakley,
Kevin Daudt, Jacob Keller, Elijah Newren
Updated examples with better description for force push and reset HEAD, as
suggested by Lars [11].
Thanks and regards,
Sidhant Sharma
[11]: http://thread.gmane.org/gmane.comp.version-control.git/289365/focus=289495
---
Implement a beginner mode for Git.
Abstract
Git is a very powerful version control system, with an array of features
that lend the user with great capabilities. But it often so happens that some
beginners are overwhelmed by its complexity and are unable to fully understand
and thus, utilize Git. Moreover, often beginners do not fully understand
the command they are using and end up making destructive (and occasionally,
irreversible) changes to the repository.
The beginner mode will assist such users in using Git by warning them
before making possibly destructive changes. It will also display tips and
short snippets of documentation for better understanding the Git model.
Google summer of code Idea suggested here:
http://git.github.io/SoC-2016-Ideas/#git-beginner
About Me
Name : Sidhant Sharma
Email [1] : Sidhant.Sharma1208 <at> gmail.com
Email [2] : Tigerkid001 <at> gmail.com
College : Delhi Technological University
Studying : Software Engineering
IRC : tk001 (or _tk_)
Phone : 91-9990-606-081
Country : India
Interests : Computers, Books, Photography
Github : Tigerkid001
LinkedIn : https://in.linkedin.com/in/sidhantsharma12
Technical Experience
Authored several Mozilla Firefox and Google Chrome extensions:
Firefox: Owl [1], Blink [2], Spoiler Jedi [3]
Chrome: Blink [4]
Developed a robust Plugin framework for Android [5] for a startup.
Learning Linux kernel programming via the Eudyptula Challenge [6]
(currently level 6).
Developed natural language processor for sarcasm detection [7] in tweets.
Developed hand gesture detection module [8] as a college minor project.
Active Firefox Add-ons Editor at AMO [9].
Currently working on a restaurant image classification project as second college
minor project.
Why I chose Git
I have been using Git for about two years now, and it has become an
indispensable daily-use tool for me. Getting a chance to participate in GSoC
for the first time under Git is very exciting. It will give me an opportunity
to intimately know the system and a chance to help in making it better and more
powerful.
Proposal
Ideas Page: Git Beginner [10]
The following tasks summarize the project:
Implement a wrapper around Git
A wrapper is to be implemented around (currently called 'ggit'), which will
provide the following user interface:
`ggit <git-command> <options>`
For example, `ggit add --all`
The wrapper will assess the arguments passed to it, and if they are detected to
be safe, it will simply pass them through to 'git'. This approach is favorable
as the existing users of git will not be affected by the wrapper.
Warning for potentially destructive commands
For every command that is entered, the wrapper will assess the subcommand and
its options. In that, it will first check if the subcommand (eg. add,
commit, rebase) is present in a list of predefined 'potentially destructive'
commands. This can be done by searching through a radix tree for the subcommand.
If found, then the arguments to the subcommand will be checked for specific
flags. The graylisted flags for the destructive commands will be stored as an
array of regular expressions, and the current command's arguments will be
checked against them. If matches are found, a warning is displayed. 'ggit'
for the warning would be
"You are about to do X, which will permanently destroy Y. Are you sure you wish
to continue? [Y/n] "
If the user enters Y[es], the command will be executed as is (by passing it
unaltered to git). In the case of Y[es], 'ggit' will also give tips for undoing
the changes made by this command (by referring the user to correct commands and
reflog), if the command can be undone. In case the command cannot be undone,
'ggit' will display an additional line in the warning like
"The changes made by this command cannot be undone. Please proceed cautiously".
In the case of n[o], 'ggit' will exit without executing the command.
Currently, the list consists of commands like:
$ git rebase
$ git reset --hard
$ git clean -f
$ git gc --prune=now --aggressive
$ git push -f <branch>
$ git push remote [+/:]<branch>
$ git branch -D
The list will be updated after some more discussion on the list.
Usage tips and documentation
The wrapper will also be responsible for showing a short description of every
command that is entered through 'ggit'. This shall be done for every command
unconditionally. The description will be derived from the actual documentation,
but will primarily aim to help the beginner understand the Git workflow and the
Git model.
A few examples to illustrate the working of the wrapper are:
$ ggit add --all
Staging all changes and untracked files. Use ` [g]git commit` to commit the
changes.
$ ggit commit -m “Second commit”
Committing staged changes…
[master 0be3142] Second commit
4 files changed, 6 insertions(+), 2 deletions(-)
$ ggit reset HEAD~1 --hard
Resetting HEAD to 1 previous commit.
[WARNING] You are about to hard reset the current HEAD (master) by 1 commit.
This will take you back to commit b16aae3, and discard all changes make
thereafter. If you want to reset but also want to retain the changes made since,
use --soft instead of --hard.
Are you sure you want to continue? [Y/n] y
Resetting HEAD to b16aae3…
You can undo this action by resetting the HEAD to last commit you were on, that
is:
`$ ggit reset HEAD 0be3142`
In general, you can see the previous positions of HEAD by running `git reflog`.
HEAD is now at b16aae3 First commit
$ ggit push --force origin master
Pushing changes to origin/master
[WARNING] You are about to purge commits from the http://example.com/repo master
branch and overwrite its history to match yours.
State right now:
o---o---o---A---B master on http://example.com/repo
\
X---Y---Z your master
State if you continue:
o---o---o---X---Y---Z master on http://example.com/repo and your master
Commit A and B will be gone. If other people have worked on top of A or B then
they won't be able to merge their changes easily.
Are you sure you want to continue? [Y/n] n
Aborting push to origin/master
Timeline
Community Bonding Period
Week 1 : Discuss the flow of course with the mentor. Discuss adequate data
structures and search techniques to be used.
Week 2-3 : Discuss over an extensive list of commands that should be classified
as destructive. Discuss appropriate short descriptions for commands. Submit
sample patches for the same for comments and review.
Week 4 : Discuss code structure, tests, optimization for least overhead and
other details.
Coding Starts
Week 1-2 : Submit code for a basic wrapper that will warn for a subset of the
potentially destructive command, and continue if the command is safe.
and this is stored as per to provide backward compatibility.
Week 3-5 : Extend the wrapper to warn for more commands in the list, along with
proper instructions for undoing them. Write tests for the commands supported so
far.
Mid Term Evaluation
Week 6-7 : Complete support for all graylisted commands with tests.
Week 8-12: Add beginner-friendly documentation snippets to various git commands.
Week 13 : Final cleanup, final touches suggested by mentors and community.
Pens Down Date
Submission of Code to GSOC
[1]: https://addons.mozilla.org/en-US/firefox/addon/owl/
[2]: https://addons.mozilla.org/en-US/firefox/addon/blink/
[3]: https://addons.mozilla.org/en-US/firefox/addon/spoiler-jedi/
[4]: https://chrome.google.com/webstore/detail/blink-new-tab/kakaolkgegapcgdjdmlmcigejblohpkh/
[5]: https://github.com/TigerKid001/flubbr
[6]: http://eudyptula-challenge.org/
[7]: https://github.com/TigerKid001/Perry
[8]: https://github.com/TigerKid001/Dex
[9]: https://addons.mozilla.org/en-US/firefox/
[10]: http://git.github.io/SoC-2016-Ideas/#git-beginner
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-03-22 9:43 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-20 16:34 [GSOC/RFC] GSoC Proposal Draft | Git Beginner Sidhant Sharma
2016-03-20 18:52 ` Matthieu Moy
2016-03-21 7:40 ` Sidhant Sharma
2016-03-21 8:29 ` Matthieu Moy
2016-03-21 10:10 ` Sidhant Sharma
2016-03-21 10:19 ` Sidhant Sharma
2016-03-22 8:38 ` Lars Schneider
2016-03-22 9:05 ` Sidhant Sharma
2016-03-22 9:43 ` Sidhant Sharma
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 NNTP newsgroup(s).