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

Re: [RFC/GSoC] Introduction

From
Sidhant Sharma <tigerkid001@gmail.com>
Date
Mar 13, 2016, 18:33 UTC
Message-ID
<56E5B27D.7010808@gmail.com>
In-Reply-To
<1924FEBB-46F2-46EE-B190-5289588D4BED@gmail.com>
On Sunday 13 March 2016 09:20 PM, Lars Schneider wrote:
Show 8 quoted lines
> Hi Sidhant,
>
> thanks for your interest in the 'Git Beginner' mode topic. I completely 
> understand your motivation for the topic as your Git learning experience
> matches mine. However, please be aware that this is no easy project. The
> final implementation might be easy but it will require hard work to come 
> up with a design for the beginner mode that the list considers to accept.
> That being said, I am eager to learn about your ideas on the topic :-)
Hi,

I understand that this project will require much effort to find an acceptable solution and I'm prepared for it. I'm very excited to take this one up :)

Show 13 quoted lines
> Based on my previous discussions with Junio [3] I think on of the most 
> important aspects is to ensure that Git does not become harder to use.
> I thought a while about this requirement and I wonder if a wrapper called 
> 'ggit' (guarded Git) could be a solution. The wrapper would pass all 
> command line arguments to 'git' and check for potentially destructive 
> commands. If such a command is detected then the user would see a warning. 
> If the command is not destructive then 'ggit' would print a short instruction 
> how to "undo" it. The ordinary Git user would not be affected at all by the 
> wrapper. A novice Git user who is unsure about his/her command line
> usage could use `ggit` as a safety net.
>
> I am curious about your opinions on this kind of approach. I wonder if
> people would actually use such a wrapper.

Coincidentally, my approach too is a wrapper around git as you suggest. The approach is simple and straight forward, but I wasn't sure if it would be accepted on the list, mainly because it may not look consistent with the current interface `git command [options]`. Perhaps a configuration like `core.beginnerMode` [4] might be apt? By default, it can be false, making git behave normally. When set, a safety-check can be run before the command is executed to ensure it's not potentially destructive. Very much like a wrapper but on the inside. There can be an option like `--no-beginner` to override this configuration from the command-line. I was wondering if there should be command-specific options as well, such as `beginner.allowForcePush`, `beginner.allowRebase` etc. for a finer control over what commands git would warn the user about. By default, all are set to false, and warning is shown when any of them is encountered. Another configuration that may be considered is `beginner.strict`, which when set would just print the warning and die, instead of giving the user an option to continue (though I'm a little unsure whether this one would be a good idea). One thing that bothers me about this approach is that unlike the explicit 'ggit' wrapper, an internal wrapper would add (unnecessary?) overhead for most commands, thus impacting the performance. Will that be an issue?

Along with this, the idea of showing a short instruction for undoing commands sounds very nice as it'll help beginners to understand and use git better.

I'm eager to know your opinions on this approach :)

Other than this, I also tried to expand the list of potentially destructive commands and updated the list as follows (additions in brackets):

* git rebase [ git pull --rebase ]
* git reset --hard
* git clean -f
* git gc --prune=now --aggressive
* git push -f [ git push <remote> :<branch>, git push <remote> +<branch> ]
* [ git branch -D ]
Are these additions appropriate? What other commands should be included?

Thanks and regards, Sidhant Sharma

[4]: http://thread.gmane.org/gmane.comp.version-control.git/285893/focus=286663
Previous: Lars SchneiderNext: Kevin Daudt
Message 3 of 23 in “[RFC/GSoC] Introduction”
  1. Sidhant SharmaMar 12, 2016
  2. Lars SchneiderMar 13, 2016
  3. Sidhant SharmaMar 13, 2016
  4. Kevin DaudtMar 13, 2016
  5. Sidhant SharmaMar 14, 2016
  6. Jacob KellerMar 14, 2016
  7. Junio C HamanoMar 14, 2016
  8. Jacob KellerMar 13, 2016
  9. Sidhant SharmaMar 14, 2016
  10. Jacob KellerMar 14, 2016
  11. Sidhant SharmaMar 14, 2016
  12. Junio C HamanoMar 14, 2016
  13. Lars SchneiderMar 14, 2016
  14. Sidhant SharmaMar 14, 2016
  15. Matthieu MoyMar 20, 2016
  16. Junio C HamanoMar 14, 2016
  17. Matthieu MoyMar 20, 2016
  18. Philip OakleyMar 14, 2016
  19. Sidhant SharmaMar 17, 2016
  20. Lars SchneiderMar 20, 2016
  21. Sidhant SharmaMar 20, 2016
  22. Lars SchneiderMar 20, 2016
  23. Sidhant SharmaMar 20, 2016

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.