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

Re: GSoC 2010: "Integrated Web Client for git" proposal

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 20, 2010, 18:14 UTC
Message-ID
<201004202014.19477.jnareb@gmail.com>
In-Reply-To
<20100419115113.GC3563@machine.or.cz>
On Mon, Apr 19, 2010, Petr Baudis wrote:
> On Mon, Apr 19, 2010 at 12:43:22PM +0200, Jakub Narebski wrote:
>> On Sun, Apr 18, 2010 at 21:56 +0200, Petr Baudis wrote:
Show 7 quoted lines
>>> If the project is a success, I wanted to use it for mob branch editing
>>> on repo.or.cz. It could also be used as open-source Gist alternative.
>> 
>> For that you would need editing file / editing contents action, but
>> this is explicitely excluded in current version of Pavan's proposal :-(
> 
> Is it? I see it only being omitted.

At the end, in the section which describes what would be not included in the project, there was editing files excluded from project.

Which is a bit strange because you need some kind of web editor (even
if it is simply textarea) for the commit message if this "Web Client"
is to implement [git commit]...
 
Show 8 quoted lines
>>> But it needs to be coded so that it does not require an actual checked
>>> out copy (which shouldn't be too much hassle).
>> 
>> It would require using 'git hash-object -t blob -w --stdin' (from body
>> submitted via POST from textarea) plus 'git update-index --cacheinfo'.
> 
> Yes. Not a whole lot of effort, seems to me. A downside is that you
> cannot use the working tree - index dichotomy, but life isn't perfect.
What do you mean here by "working tree - index dichotomy"?
 
Show 6 quoted lines
>> There is however complication that you would need to do open2/open3
>> because git-hash-object would require bidirectional communication unless
>> you would use temporary file (command_bidi_pipe in Git.pm, untested).
> 
> I think even just going through a temporary file is fine for initial
> implementation.

It is not that difficult. You can use IPC::Open2 (which is in core) and IO::Handle (for easier coding; using IO::Handle is not strictly necessary), like that:

  use IPC::Open2 qw(open2);
  use IO::Handle;
  ...
  my $pid = open2($out, $in, git_cmd(), 'hash-object', '-w', '--stdin');
  $in->printflush($cgi->param('textarea'))
     or die...;
  my $sha1 = $out->getline();
  chomp $sha1;
  close $out;
  waitpid $pid, 0;
Then you would need:
  system(git_cmd(), 'update-index', '--cacheinfo',
         '100644', $sha1, $pretend_path)
    or die...;
Not tested!
-- 
Jakub Narebski
Poland
Previous: Petr BaudisNext: Pavan Kumar Sunkara
Message 26 of 39 in “GSoC 2010: "Integrated Web Client for git" proposal”
  1. Christian CouderApr 15, 2010
  2. Jakub NarebskiApr 18, 2010
  3. Petr BaudisApr 18, 2010
  4. Jakub NarebskiApr 18, 2010
  5. Petr BaudisApr 18, 2010
  6. Pavan Kumar SunkaraApr 18, 2010
  7. Jakub NarebskiApr 18, 2010
  8. Petr BaudisApr 18, 2010
  9. Pavan Kumar SunkaraApr 19, 2010
  10. Matthieu MoyApr 19, 2010
  11. Junio C HamanoApr 19, 2010
  12. Pavan Kumar SunkaraApr 19, 2010
  13. Petr BaudisApr 19, 2010
  14. Matthieu MoyApr 19, 2010
  15. Pavan Kumar SunkaraApr 19, 2010
  16. Matthieu MoyApr 19, 2010
  17. Petr BaudisApr 19, 2010
  18. Pavan Kumar SunkaraApr 19, 2010
  19. Petr BaudisApr 20, 2010
  20. Jakub NarebskiApr 18, 2010
  21. Petr BaudisApr 18, 2010
  22. Jakub NarebskiApr 19, 2010
  23. Petr BaudisApr 19, 2010
  24. Pavan Kumar SunkaraApr 19, 2010
  25. Petr BaudisApr 20, 2010
  26. Jakub NarebskiApr 20, 2010
  27. Pavan Kumar SunkaraApr 21, 2010
  28. Petr BaudisApr 22, 2010
  29. Junio C HamanoApr 22, 2010
  30. Petr BaudisApr 23, 2010
  31. Junio C HamanoApr 23, 2010
  32. Pavan Kumar SunkaraApr 22, 2010
  33. Christian CouderApr 23, 2010
  34. Pavan Kumar SunkaraApr 23, 2010
  35. Pavan Kumar SunkaraApr 19, 2010
  36. Jakub NarebskiApr 19, 2010
  37. Pavan Kumar SunkaraApr 19, 2010
  38. Jakub NarebskiApr 19, 2010
  39. Pavan Kumar SunkaraApr 20, 2010

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.