30 Jun 14:38
help with grep search string
Graeme Geldenhuys <graemeg <at> opensoft.homeip.net>
2009-06-30 12:38:59 GMT
2009-06-30 12:38:59 GMT
Hi,
I want to try and improve the IDE to detect SVN or Git repositories, and still extract the correct latest
revision number. I have the following output which is part of the commit message generated by Git, when it
syncs with a SubVersion repository.
I'm trying to write a grep command that will extract the revision number only.
eg:
16557
16556
16555
...
Can anybody help me please? I wrote the following which asks git to only output commit messages containing
"git-svn-id", then I run that through standard grep extracting only the line containing the search
string. It's this latter part that I want to fix to only return the revision number.
Any help would be greatly appreciated.
$ git log --grep="git-svn-id:" | grep git-svn-id
============ Sample output ===================
git-svn-id: http://svn2.freepascal.org/svn/lazarus/trunk <at> 16557 4005530d-fff6-0310-9dd1-cebe43e6787f
git-svn-id: http://svn2.freepascal.org/svn/lazarus/trunk <at> 16556 4005530d-fff6-0310-9dd1-cebe43e6787f
git-svn-id: http://svn2.freepascal.org/svn/lazarus/trunk <at> 16555 4005530d-fff6-0310-9dd1-cebe43e6787f
git-svn-id: http://svn2.freepascal.org/svn/lazarus/trunk <at> 16554 4005530d-fff6-0310-9dd1-cebe43e6787f
git-svn-id: http://svn2.freepascal.org/svn/lazarus/trunk <at> 16553 4005530d-fff6-0310-9dd1-cebe43e6787f
git-svn-id: http://svn2.freepascal.org/svn/lazarus/trunk <at> 16552 4005530d-fff6-0310-9dd1-cebe43e6787f
=======================================
Regards,
- Graeme -
--
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/
--
_______________________________________________
Lazarus mailing list
Lazarus <at> lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
RSS Feed