threads / discuss / 1384

Re: Git 1.0 Synopis (Draft v3

Subject: Re: Git 1.0 Synopis (Draft v3

## tl;dr

19 messages between Jul 31, 2005 and May 29, 2006.

replies: 18people: 7as markdown or json

Horst von Brand· Jul 31, 2005, 22:15 UTC · lore
Ryan Anderson <ryan@michonline.com> wrote:
> Source Code Management with Git
More bugging...
- Either stay with your idea of "Git is the idea, git the implementation"
  (iff blessed by the Git Powers That Be) and be consistent about it, or
  just use "git" throughout.
- Attribute the meaning appropiately, say by:
In Linus' own words as the inventor of git:
Show 10 quoted lines
> "git" can mean anything, depending on your mood.
> 
>  - random three-letter combination that is pronounceable, and not
>    actually used by any common UNIX command.  The fact that it is a
>    mispronunciation of "get" may or may not be relevant.
>  - stupid. contemptible and despicable. simple. Take your pick from the
>    dictionary of slang.
>  - "global information tracker": you're in a good mood, and it actually
>    works for you. Angels sing, and a light suddenly fills the room. 
>  - "goddamn idiotic truckload of sh*t": when it breaks
[...]
Show 22 quoted lines
> To get a copy of Git:
> 	Daily snapshots are available at:
> 	http://www.codemonkey.org.uk/projects/git-snapshots/git/
> 	(Thanks to Dave Jones)
> 
> 	Source tarballs and RPMs at:
> 	http://www.kernel.org/pub/software/scm/git/
> 
> 	Deb packages at:
> 	<insert url here>
> 
> 	Or via Git itself:
> 	git clone http://www.kernel.org/pub/scm/git/git.git/ <local directory>
> 	git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ <local directory>
> 
> 	(rsync is generally faster for an initial clone, you can switch later
> 	by editing .git/branches/origin and changing the url)
> 
> To get the 'Porcelain' tools mentioned above:
> 	SCM Interface layers:
> 	cogito - http://www.kernel.org/pub/software/scm/cogito/
> 	StGIT - http://www.procode.org/stgit/

At least cogito includes a (slightly old) version of git. Dunno about StGIT. And git and cogito have a gitk inside too. This should be mentioned, i.e., look at the package(s) you are interested and see what else they carry or require and keep in mind that (for now?) getting git as part of one package is /not/ guaranteed to be compatible with another or standard git.

-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
Ryan Anderson· Aug 15, 2005, 04:55 UTC · re: Horst von Brand · lore

Git 1.0 Synopis (Draft v4)

On Sun, Jul 31, 2005 at 06:15:40PM -0400, Horst von Brand wrote:
> Ryan Anderson <ryan@michonline.com> wrote:
> > Source Code Management with Git
> 
> More bugging...
Ok, I think I've got all this addressed (plus the other email).
It just took me a lot longer to get to it than I planned.

Junio, do you want to pull this into the git tree? (I'll reply with a patch)

==========
Source Code Management with git

In Linus's own words as the creator of git: "git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room. 
 - "goddamn idiotic truckload of sh*t": when it breaks

git is a "directory content manager". git has been designed to handle absolutely massive projects with speed and efficiency, and the release of the 2.6.12 and (soon) the 2.6.13 version of the Linux kernel would indicate that it does this task well.

git falls into the category of distributed source code management tools, similar to Arch or Darcs (or, in the commercial world, BitKeeper). Every git working directory is a full-fledged repository with full revision tracking capabilities, not dependent on network access to a central server.

git provides a content-addressable pseudo filesystem, complete with its own version of fsck.

  o Speed of use, both for the project maintainer, and the end-users, is
    a key development principle.
  o The history is stored as a directed acyclic graph, making long-lived
    branches and repeated merging simple.
  o The core git project considers itself to provide "plumbing" for other
     projects, as well as to serve to arbitrate for compatibility between them.
     The project built on top of the core git are referred to as "porcelain".
     Stgit, Cogito, qgit, gitk and gitweb are all building upon the core git
     tools, and providing an easy to use interface to various pieces of
     functionality.
  o Some other projects have taken the concepts from the core git project, and
    are either porting an existing toolset to use the git tools, or
    reimplementing the concepts internally, to benefit from the performance
     improvements.  This includes both Arch 2.0, and Darcs-git.
  
  o Two, interchangeable, on-disk formats are used:
    o An efficient, packed format that saves space and network
      bandwidth.
    o An unpacked format, optimized for fast writes and incremental
      work.
To get a copy of git:
	Daily snapshots are available at:
	http://www.codemonkey.org.uk/projects/git-snapshots/git/
	(Thanks to Dave Jones)
	Source tarballs and RPMs at:
	http://www.kernel.org/pub/software/scm/git/
	Debian packages should be availabe in unstable (sid) as "git-core"
	Or via git itself:
	git clone http://www.kernel.org/pub/scm/git/git.git/ <local directory>
	git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ <local directory>
	(rsync is generally faster for an initial clone, you can switch later
	by editing .git/branches/origin and changing the url)
To get the 'Porcelain' tools mentioned above:
	SCM Interface layers:
	cogito - http://www.kernel.org/pub/software/scm/cogito/
	Patch Management (similar to Quilt):
	StGIT - http://www.procode.org/stgit/
	History Visualization:
	gitk - http://ozlabs.org/~paulus/gitk/ (Included in the standard git
		distribution)
	gitweb - http://www.kernel.org/pub/software/scm/gitweb/
	qgit - http://sourceforge.net/projects/qgit

git distributions contain a tutorial in the Documentation subdirectory. Additionally, the Kernel-Hacker's git Tutorial at http://linux.yyz.us/git-howto.html may be useful. (Thanks to Jeff Garzik for that document)

git development takes place on the git mailing list. To subscribe, send an email with just "subscribe git" in the body to majordomo@vger.kernel.org. Mailing list archives are available at http://marc.theaimsgroup.com/?l=git

(This summary written by Ryan Anderson <ryan@michonline.com>. Please bug him with any corrections or complaints.)

-- 
Ryan Anderson
  sometimes Pug Majere
Ryan Anderson· Aug 15, 2005, 05:09 UTC · re: Ryan Anderson · lore

Re: Git 1.0 Synopis (Draft v4)

Add a SYNOPSIS/release summary to the tree.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
diff --git a/SYNOPSIS b/SYNOPSIS
new file mode 100644
--- /dev/null
+++ b/SYNOPSIS
@@ -0,0 +1,93 @@
+Source Code Management with git
+
+In Linus's own words as the creator of git:
+"git" can mean anything, depending on your mood.
+
+ - random three-letter combination that is pronounceable, and not
+   actually used by any common UNIX command.  The fact that it is a
+   mispronunciation of "get" may or may not be relevant.
+ - stupid. contemptible and despicable. simple. Take your pick from the
+   dictionary of slang.
+ - "global information tracker": you're in a good mood, and it actually
+   works for you. Angels sing, and a light suddenly fills the room. 
+ - "goddamn idiotic truckload of sh*t": when it breaks
+
+git is a "directory content manager".  git has been designed to handle
+absolutely massive projects with speed and efficiency, and the release of the
+2.6.12 and (soon) the 2.6.13 version of the Linux kernel would indicate that it
+does this task well.
+
+git falls into the category of distributed source code management tools,
+similar to Arch or Darcs (or, in the commercial world, BitKeeper).  Every git
+working directory is a full-fledged repository with full revision tracking
+capabilities, not dependent on network access to a central server.
+
+git provides a content-addressable pseudo filesystem, complete with its own
+version of fsck.
+
+  o Speed of use, both for the project maintainer, and the end-users, is
+    a key development principle.
+
+  o The history is stored as a directed acyclic graph, making long-lived
+    branches and repeated merging simple.
+
+  o The core git project considers itself to provide "plumbing" for other
+     projects, as well as to serve to arbitrate for compatibility between them.
+     The project built on top of the core git are referred to as "porcelain".
+     Stgit, Cogito, qgit, gitk and gitweb are all building upon the core git
+     tools, and providing an easy to use interface to various pieces of
+     functionality.
+
+  o Some other projects have taken the concepts from the core git project, and
+    are either porting an existing toolset to use the git tools, or
+    reimplementing the concepts internally, to benefit from the performance
+     improvements.  This includes both Arch 2.0, and Darcs-git.
+  
+  o Two, interchangeable, on-disk formats are used:
+    o An efficient, packed format that saves space and network
+      bandwidth.
+    o An unpacked format, optimized for fast writes and incremental
+      work.
+
+To get a copy of git:
+	Daily snapshots are available at:
+	http://www.codemonkey.org.uk/projects/git-snapshots/git/
+	(Thanks to Dave Jones)
+
+	Source tarballs and RPMs at:
+	http://www.kernel.org/pub/software/scm/git/
+
+	Debian packages should be availabe in unstable (sid) as "git-core"
+
+	Or via git itself:
+	git clone http://www.kernel.org/pub/scm/git/git.git/ <local directory>
+	git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ <local directory>
+
+	(rsync is generally faster for an initial clone, you can switch later
+	by editing .git/branches/origin and changing the url)
+
+To get the 'Porcelain' tools mentioned above:
+	SCM Interface layers:
+	cogito - http://www.kernel.org/pub/software/scm/cogito/
+
+	Patch Management (similar to Quilt):
+	StGIT - http://www.procode.org/stgit/
+
+	History Visualization:
+	gitk - http://ozlabs.org/~paulus/gitk/ (Included in the standard git
+		distribution)
+	gitweb - http://www.kernel.org/pub/software/scm/gitweb/
+	qgit - http://sourceforge.net/projects/qgit
+
+
+git distributions contain a tutorial in the Documentation subdirectory.
+Additionally, the Kernel-Hacker's git Tutorial at
+http://linux.yyz.us/git-howto.html may be useful.  (Thanks to Jeff Garzik for
+that document)
+
+git development takes place on the git mailing list.  To subscribe, send an
+email with just "subscribe git" in the body to majordomo@vger.kernel.org.
+Mailing list archives are available at http://marc.theaimsgroup.com/?l=git
+
+(This summary written by Ryan Anderson <ryan@michonline.com>.  Please bug him
+with any corrections or complaints.)
-- 
Ryan Anderson
  sometimes Pug Majere
Junio C Hamano· Aug 15, 2005, 05:19 UTC · re: Ryan Anderson · lore

Re: Git 1.0 Synopis (Draft v4)

Ryan Anderson <ryan@michonline.com> writes:
> Junio, do you want to pull this into the git tree?

Yes, but I have been wondering where it should go. Should it go under Documentation/ and made into html via asciidoc along with other tools?

Ryan Anderson· Aug 15, 2005, 06:58 UTC · re: Junio C Hamano · lore

Re: Git 1.0 Synopis (Draft v4)

On Sun, Aug 14, 2005 at 10:19:18PM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> Ryan Anderson <ryan@michonline.com> writes:
> 
> > Junio, do you want to pull this into the git tree?
> 
> Yes, but I have been wondering where it should go.  Should it go
> under Documentation/ and made into html via asciidoc along with
> other tools?

I was somewhat thinking it should go in the main directory, and be a useful introduction to the project for people.... but it's not really aimed at that very well, now that I think about it.

To be fair, it's not really aimed well at being documentation for people that already have git, either. I've been writing it with the idea of "something to send to LWN when 1.0 happens so they can post it mostly verbatim."

I guess this means, "I dunno, either place works for me."
-- 
Ryan Anderson
  sometimes Pug Majere
Junio C Hamano· Aug 15, 2005, 07:17 UTC · re: Ryan Anderson · lore

Re: Git 1.0 Synopis (Draft v4)

Ryan Anderson <ryan@michonline.com> writes:
> I guess this means, "I dunno, either place works for me."

I was hoping it means to "Oh, come to think of it, maybe I should send this to corbet@lwn.net" ;-).

I agree with you that this may be a lot more suitable for people _before_ they get the git sources, which is to say it may make more sense not to include in core-git tarball but is made into a patch to Pasky's introduction website.

Ryan Anderson· Aug 15, 2005, 08:02 UTC · re: Junio C Hamano · lore

Re: Git 1.0 Synopis (Draft v4)

On Mon, Aug 15, 2005 at 12:17:46AM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> Ryan Anderson <ryan@michonline.com> writes:
> 
> > I guess this means, "I dunno, either place works for me."
> 
> I was hoping it means to "Oh, come to think of it, maybe I
> should send this to corbet@lwn.net" ;-).
I was waiting until you said, "Ok, 1.00 tomorrow morning"
> I agree with you that this may be a lot more suitable for people
> _before_ they get the git sources, which is to say it may make
> more sense not to include in core-git tarball but is made into a
> patch to Pasky's introduction website.
Good point.
It's already there (now that I found the site.)
-- 
Ryan Anderson
  sometimes Pug Majere
Junio C Hamano· Aug 15, 2005, 08:17 UTC · re: Ryan Anderson · lore

Re: Git 1.0 Synopis (Draft v4)

Ryan Anderson <ryan@michonline.com> writes:
> I was waiting until you said, "Ok, 1.00 tomorrow morning"

Makes sense. There would be some weeks until that happens I am afraid.

Daniel Barkalow· Aug 15, 2005, 18:59 UTC · re: Junio C Hamano · lore

Re: Git 1.0 Synopis (Draft v4)

On Mon, 15 Aug 2005, Junio C Hamano wrote:
Show 6 quoted lines
> Ryan Anderson <ryan@michonline.com> writes:
> 
> > I was waiting until you said, "Ok, 1.00 tomorrow morning"
> 
> Makes sense.  There would be some weeks until that happens I am
> afraid.

It might be worth putting the list of things left to do before 1.0 in the tree (since they clearly covary), and it would be useful to know what you're thinking of as preventing the release at any particular stage.

	-Daniel
*This .sig left intentionally blank*
Junio C Hamano· Aug 16, 2005, 07:28 UTC · re: Daniel Barkalow · lore

Re: Git 1.0 Synopis (Draft v4)

Daniel Barkalow <barkalow@iabervon.org> writes:
> It might be worth putting the list of things left to do before 1.0 in the 
> tree (since they clearly covary), and it would be useful to know what 
> you're thinking of as preventing the release at any particular stage.
Yeah, yeah.  Call me lazy.

Excerpts from my "last mile to 1.0", my Itchlist, and pieces from random other messages since then.

- Documentation. [I really need help here --- among ~7000 lines
  there, I've written around 2500 lines, David Greaves another
  2500, and Linus 1400.  And it is not very easy to proofread
  what you wrote yourself.]
  - Are all the core commands described in Documentation/
    directory?
  - Many files under Documentation/ directory have become stale.
    I've tried to do one pass of full sweep recently [and
    another since I wrote the original "last mile" message], but
    I'd like somebody else to make another pass to make sure
    that the usage strings in programs, what the programs do,
    and what Documentation says they do match.  Also, the
    spelling and grammar fixes, which I am very bad at and have
    not done any attempt, needs to be done.
    Volunteers?
  - Are all the files in Documentation/ reachable from git(7)
    or otherwise made into a standalone document using asciidoc
    by the Makefile?  I haven't looked into documentation
    generation myself (I use only the text files as they are);
    help to update the Makefile by somebody handy with asciidoc
    suite is greatly appreciated here.
    Volunteers?
  - We may want to describe more Best Current Practices, along
    the lines of "Working with Others" section in the tutorial.
    Please write on your faviorite topic and send patches in
    ;-)) [ryan started collecting Documentation/howto which
    would greatly help in this area].
  - Glossary documentation Johannes Schindelin is working on.
    I think coming up with the concensus of terms would come
    fairly quickly on the list.  Updating docs to match the
    concensus may take some time.  Help is greatly appreciated.
  - Maybe doing another pass at tutorial.  Could somebody run
    (or preferably, find a friend who has never touched git and
    have her run) the tutorial examples from the beginning to
    the end, and find rooms of improvements?  Does the order of
    materials presented make sense?  Do we talk about things
    assuming that the user knows something else that we have not
    talked about?  Have we introduced better way of doing the
    same thing since the tutorial was written?
    I've done that once with the text that is currently in the
    head of the master branch, but that is getting rather stale,
    and also I did that myself so I am sure I've sidestepped
    pitfalls without even realizing.

The above does not have to be all there in 0.99.5, but I consider that lack of any of the above to block 1.0.

- Commit walker downloading from packed repository is finally
  complete.  Thanks, Daniel!
- Teach fetch-pack reference renaming.
  On the push side, send-pack now knows updating arbitrary
  remote references from local references.  We need something
  similar for fetching [since then I outlined the design of the
  new shorthand file format and semantics but have not got
  around to actually do it.  Maybe on my next GIT day...].  This
  is scheduled for 0.99.5.
- commit template filler discussed with Pasky some time ago,
  with perhaps pre-commit and post-commit hooks.  Somehow the
  discussion died out but that does not mean _I_ forgot about
  it.
- Binary packaging.  Should _I_ worry about "/usr/bin/git" stay
  there myself --- I think not.  But I _do_ want to help Debian
  packaging folks if that path is causing problems in their
  effort to push git-core into the official Debian archive.
  As Linus mentioned earlier, this seems to be a Debian specific
  problem, and will not block 1.0 --- if Debian heavyweights do
  not want to stay compatible with the rest of the world, so be
  it.
- I have not heard from Darwin or BSD people for some time.  Is
  your portfile up to date?  Do you have updates you want me to
  include?  Have we introduced non-Linux non-GNU
  incompatibilities lately that you want to see fixed and/or
  worked around?
  Again, I consider binary packaging issue independent from our
  release schedule; it is a distribution local issue, so this
  would not block 1.0 in any way.  But I _am_ willing to help
  them.
- Oh, another itch I did not list in the previous message.  Is
  anybody interested in doing an Emacs VC back-end for GIT?
- git prune and git fsck-cache; think about their interactions
  with an object database that borrows from another.  This
  includes the case where .git/objects itself is symlinked to
  somewhere else (i.e. running "git prune" that somewhere else
  without consulting this repository would lose objects), and
  alternates pointing at somewhere else (i.e. ditto).
  My personal feeling is that we should just warn users about
  doing .git/objects symlinking and/or alternates pointing ---
  do not do it unless you have an off-line arrangement with the
  owner of the repository you are borrowing from.  Even if that
  would become our official position to take, it needs to be
  documented clearly before we declare this issue to have been
  "dealt with".

I am sure I am forgetting something, but the above would be a good start.

Johannes Schindelin· Aug 16, 2005, 10:03 UTC · re: Junio C Hamano · lore

Re: Git 1.0 Synopis (Draft v4)

Hi,
On Tue, 16 Aug 2005, Junio C Hamano wrote:
>   - Glossary documentation Johannes Schindelin is working on.

Yeah, yeah. Call _me_ lazy :-) I'll try to come up with a discussable item today.

Show 6 quoted lines
> - git prune and git fsck-cache; think about their interactions
>   with an object database that borrows from another.  This
>   includes the case where .git/objects itself is symlinked to
>   somewhere else (i.e. running "git prune" that somewhere else
>   without consulting this repository would lose objects), and
>   alternates pointing at somewhere else (i.e. ditto).

I don´t see how git could help in the case you are pruning a repository which another repository points to. After all, the first repository doesn´t know about being used by the second.

> I am sure I am forgetting something, but the above would be a
> good start.

Maybe your $GIT_DIR/remotes idea? Along with a "--store <remotename>" flag to git-pull-script?

Ciao, Dscho

Johannes Schindelin· Aug 16, 2005, 15:31 UTC · re: Junio C Hamano · lore

Re: Git 1.0 Synopis (Draft v4)

Hi,
On Tue, 16 Aug 2005, Junio C Hamano wrote:
Show 8 quoted lines
>   - Are all the files in Documentation/ reachable from git(7)
>     or otherwise made into a standalone document using asciidoc
>     by the Makefile?  I haven't looked into documentation
>     generation myself (I use only the text files as they are);
>     help to update the Makefile by somebody handy with asciidoc
>     suite is greatly appreciated here.
> 
>     Volunteers?
The attached script reveals:

git-unpack-objects.txt is not reachable from git.txt git-cvsimport-script.txt is not reachable from git.txt git-send-email-script.txt is not reachable from git.txt git-rename-script.txt is not reachable from git.txt tutorial.txt is not reachable from git.txt git-show-index.txt is not reachable from git.txt cvs-migration.txt is not reachable from git.txt diffcore.txt is not reachable from git.txt git-ls-remote-script.txt is not reachable from git.txt git-apply.txt is not reachable from git.txt git-diff-stages.txt is not reachable from git.txt pack-protocol.txt is not reachable from git.txt

Ciao, Dscho

Daniel Barkalow· Aug 16, 2005, 15:47 UTC · re: Johannes Schindelin · lore

Re: Git 1.0 Synopis (Draft v4)

On Tue, 16 Aug 2005, Johannes Schindelin wrote:
Show 27 quoted lines
> Hi,
>
> On Tue, 16 Aug 2005, Junio C Hamano wrote:
>
> >   - Are all the files in Documentation/ reachable from git(7)
> >     or otherwise made into a standalone document using asciidoc
> >     by the Makefile?  I haven't looked into documentation
> >     generation myself (I use only the text files as they are);
> >     help to update the Makefile by somebody handy with asciidoc
> >     suite is greatly appreciated here.
> >
> >     Volunteers?
>
> The attached script reveals:
>
> git-unpack-objects.txt is not reachable from git.txt
> git-cvsimport-script.txt is not reachable from git.txt
> git-send-email-script.txt is not reachable from git.txt
> git-rename-script.txt is not reachable from git.txt
> tutorial.txt is not reachable from git.txt
> git-show-index.txt is not reachable from git.txt
> cvs-migration.txt is not reachable from git.txt
> diffcore.txt is not reachable from git.txt
> git-ls-remote-script.txt is not reachable from git.txt
> git-apply.txt is not reachable from git.txt
> git-diff-stages.txt is not reachable from git.txt
> pack-protocol.txt is not reachable from git.txt

The ones that don't start with git probably don't belong in the same set; perhaps there should be a "technical" (or something similar but shorter) subdirectory for developer documentation instead of user documentation? (And tutorial and cvs-migration can move to howto)

	-Daniel
*This .sig left intentionally blank*
Daniel Barkalow· Aug 16, 2005, 15:39 UTC · re: Junio C Hamano · lore

Re: Git 1.0 Synopis (Draft v4)

On Tue, 16 Aug 2005, Junio C Hamano wrote:
Show 15 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
>
> > It might be worth putting the list of things left to do before 1.0 in the
> > tree (since they clearly covary), and it would be useful to know what
> > you're thinking of as preventing the release at any particular stage.
>
> Yeah, yeah.  Call me lazy.
>
> Excerpts from my "last mile to 1.0", my Itchlist, and pieces from
> random other messages since then.
>
> - Documentation. [I really need help here --- among ~7000 lines
>   there, I've written around 2500 lines, David Greaves another
>   2500, and Linus 1400.  And it is not very easy to proofread
>   what you wrote yourself.]

I'm not sure how done this can actually get before some sort of feature freeze; the best ways to do things keeps changing as more convenient ways are added. Once the new stuff is diverted to post-1.0, I'd be interested in going through it.

Show 6 quoted lines
> - git prune and git fsck-cache; think about their interactions
>   with an object database that borrows from another.  This
>   includes the case where .git/objects itself is symlinked to
>   somewhere else (i.e. running "git prune" that somewhere else
>   without consulting this repository would lose objects), and
>   alternates pointing at somewhere else (i.e. ditto).

It should be fine, but only if .git/refs is symlinked to the matching place; this gives you the same repository with multiple working trees. Having refs/ and objects/ directories that aren't always together would be much less safe.

	-Daniel
*This .sig left intentionally blank*
Horst von Brand· May 29, 2006, 21:06 UTC · lore

Re: [PATCH] git-send-email.perl extract_valid_address issue

Ryan Anderson <ryan@michonline.com> wrote:
Show 39 quoted lines
> On Mon, May 29, 2006 at 12:00:44AM -0400, Nicolas Troncoso Carrere wrote:
> > 
> > The third fallback was returning if the match was done or not instead of
> > returning the actual email address that was matched. This prevented sending
> > the mail to the people included in the CC. This bug only affect those that
> > dont have Email::Valid.
> > 
> > I initialized $valid_email as undef so it would mimic the behavior of 
> > Email::Verify->address(), which returns undef if no valid address was found.
> 
> Odd, I noticed the same thing this weekend.
> 
> > Signed-off-by: Nicolas <ntroncos@inf.utfsm.cl>
> Acked-by: Ryan Anderson <ryan@michonline.com>
> 
> (Or pick up my patch that fixes this in a slightly different way)
> 
> > 
> > 
> > ---
> > 
> >  git-send-email.perl |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > 84853ca89c15de7a24e9eb9fd422654b86c63be9
> > diff --git a/git-send-email.perl b/git-send-email.perl
> > index 312a4ea..dfff3e6 100755
> > --- a/git-send-email.perl
> > +++ b/git-send-email.perl
> > @@ -316,7 +316,9 @@ sub extract_valid_address {
> >  	} else {
> >  		# less robust/correct than the monster regexp in Email::Valid,
> >  		# but still does a 99% job, and one less dependency
> > -		return ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
> > +                my $valid_email=undef;
> > +                ($valid_email ) = ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
> > +                return ($valid_email);
> >  	}
> >  }

I just looked it over, and this is certainly broken in the original. The first return gives the string back if it matches, the second one evaluates the list returned by the match in scalar context, and so returns 1 for a match or 0 for non-match. Besides, the regexps are fishy...

- The first one won't consider 'Joe.Hacker' as a valid local address
- The second one will consider 'Joe.Hacker@example.com"' valid (note ")

Need to make both branches (with and without @) agree here, at least. And this is certainly severely underpowered... dunno if it merits a better job (or just bail out if Email::Valid isn't found, instead of kludgeing around...)

Will propose a fix ASAP.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
Horst von Brand· May 29, 2006, 21:09 UTC · lore

Re: [PATCH] git-send-email.perl extract_valid_address issue

Fix regexps to better match email addresses if Email::Valid isn't present Make it return the address on match containing a @

Signed-off-by:  Horst H. von Brand <vonbrand@inf.utfsm.cl>
---
 git-send-email.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 312a4ea..6e39f2f 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -309,14 +309,14 @@ sub extract_valid_address {
 	my $address = shift;
 
 	# check for a local address:
-	return $address if ($address =~ /^([\w\-]+)$/);
+	return $address if ($address =~ /^([\w\-.]+)$/);
 
 	if ($have_email_valid) {
 		return Email::Valid->address($address);
 	} else {
 		# less robust/correct than the monster regexp in Email::Valid,
 		# but still does a 99% job, and one less dependency
-		return ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
+		return ($address =~ /([\w\-.]+@[\w\-.]+)/) ? $1 : undef;
 	}
 }
 
-- 
1.3.3.g0f0ac
Eric Wong· May 29, 2006, 22:12 UTC · re: Horst von Brand · lore

Re: [PATCH] git-send-email.perl extract_valid_address issue

Horst von Brand <vonbrand@inf.utfsm.cl> wrote:
Show 28 quoted lines
> Fix regexps to better match email addresses if Email::Valid isn't present
> Make it return the address on match containing a @
> 
> Signed-off-by:  Horst H. von Brand <vonbrand@inf.utfsm.cl>
> ---
>  git-send-email.perl |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 312a4ea..6e39f2f 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -309,14 +309,14 @@ sub extract_valid_address {
>  	my $address = shift;
>  
>  	# check for a local address:
> -	return $address if ($address =~ /^([\w\-]+)$/);
> +	return $address if ($address =~ /^([\w\-.]+)$/);
>  
>  	if ($have_email_valid) {
>  		return Email::Valid->address($address);
>  	} else {
>  		# less robust/correct than the monster regexp in Email::Valid,
>  		# but still does a 99% job, and one less dependency
> -		return ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
> +		return ($address =~ /([\w\-.]+@[\w\-.]+)/) ? $1 : undef;
>  	}
>  }
Oops on the original bug, my fault :x
Acked-by: Eric Wong <normalperson@yhbt.net>
-- 
Eric Wong

← back to recent threads