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

Re: gitco - replacement for cvsco

From
Simon Josefsson <simon@josefsson.org>
Date
Feb 28, 2007, 21:31 UTC
Message-ID
<87y7mirmts.fsf@latte.josefsson.org>
In-Reply-To
<20070228195536.GB4149@nan92-1-81-57-214-146.fbx.proxad.net>
Yann Dirson <ydirson@altern.org> writes:
Show 29 quoted lines
> As a big fan of cvsco and friends, I admit I often miss that one in
> git repos.
>
> On Wed, Feb 28, 2007 at 03:08:02PM +0100, Simon Josefsson wrote:
>> However, one problem with that, compared to 'cvsco', is that
>> 'git-reset --hard' does not tell me tell me which files were deleted
>> and which file were restored.  May I suggest a --verbose or similar?
>
> Here is a small change to your script that does just that.  It is far
> from perfect:
>
> - uses cogito and not plain git.  Not sure how to achieve the same
> compact layout with plain git - both cogito and stgit forge this type
> of output themselves.  Would be great to get it directly from git
> itself...
>
> - not very efficient, and not very secure, since we scan the tree once
> for reporting and then once for deleting the files, leaving a window
> where files could be created by another program after the cg-status
> call, and then removed by git-reset.
>
> You've been warned :)
>
> #!/bin/sh
> # gitco - cruel checkout.  Discards everything that has not been
> # committed, and checkout missing files.
> git clean -d -x
> cg status -w
> git reset --hard

jas@mocca:~/src/libtasn1$ gitco Removing foo M Makefile.am ! gendocs.sh jas@mocca:~/src/libtasn1$

Perfect!

Thanks, Simon

Previous: Yann DirsonNext: Johannes Schindelin
Message 7 of 19 in “Replacement for cvs2cl, for generating ChangeLog”
  1. Simon JosefssonFeb 27, 2007
  2. Junio C HamanoFeb 27, 2007
  3. Johannes SchindelinFeb 27, 2007
  4. Sergey VlasovFeb 27, 2007
  5. gitco - replacement for cvscoSimon Josefsson, Feb 28, 2007
  6. Yann DirsonFeb 28, 2007
  7. Simon JosefssonFeb 28, 2007
  8. Johannes SchindelinFeb 27, 2007
  9. Simon JosefssonFeb 28, 2007
  10. Junio C HamanoFeb 27, 2007
  11. Johannes SchindelinFeb 27, 2007
  12. Johannes SchindelinFeb 27, 2007
  13. Andy ParkinsFeb 27, 2007
  14. Johannes SchindelinFeb 27, 2007
  15. Robin RosenbergFeb 27, 2007
  16. Junio C HamanoFeb 27, 2007
  17. Johannes SchindelinFeb 27, 2007
  18. Johannes SchindelinFeb 27, 2007
  19. Simon JosefssonFeb 28, 2007

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.