]> Cypherpunks repositories - gostls13.git/commitdiff
Fix capitalisation of "Git".
authorDavid Symonds <dsymonds@golang.org>
Thu, 12 Nov 2009 01:31:28 +0000 (17:31 -0800)
committerRuss Cox <rsc@golang.org>
Thu, 12 Nov 2009 01:31:28 +0000 (17:31 -0800)
R=rsc
https://golang.org/cl/154071

src/cmd/hgpatch/doc.go
src/pkg/encoding/git85/git.go
src/pkg/patch/git.go
src/pkg/patch/patch.go

index a3d069faeb57c0d7c0c3b37a15bcd55b59178ac7..1e0f1da38666524b78dddcdea7103be3ce805005 100644 (file)
@@ -6,7 +6,7 @@
 
 Hgpatch applies a patch to the local Mercurial repository.
 The patch should have been been generated by
-a version control system like CVS, GIT, Mercurial, or Subversion.
+a version control system like CVS, Git, Mercurial, or Subversion.
 If successful, hgpatch writes a list of affected files to standard output.
 
 Hgpatch is meant to be used by the Mercurial codereview extension.
index cfe62756647849ed7e07d0a272b7e8a6bfadd004..288fd748c2e9bf29648505a61ba71a2561cf5e1d 100644 (file)
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package git85 implements the radix 85 data encoding
-// used in the GIT version control system.
+// used in the Git version control system.
 package git85
 
 import (
@@ -44,7 +44,7 @@ var decode = [256]uint8{
 // bytes of dst.  As a convenience, it returns the number
 // of bytes written to dst, but this value is always EncodedLen(len(src)).
 // Encode implements the radix 85 encoding used in the
-// GIT version control tool.
+// Git version control tool.
 //
 // The encoding splits src into chunks of at most 52 bytes
 // and encodes each chunk on its own line.
@@ -144,9 +144,9 @@ func Decode(dst, src []byte) (n int, err os.Error) {
 
 func MaxDecodedLen(n int) int  { return n / 5 * 4 }
 
-// NewEncoder returns a new GIT base85 stream encoder.  Data written to
+// NewEncoder returns a new Git base85 stream encoder.  Data written to
 // the returned writer will be encoded and then written to w.
-// The GIT encoding operates on 52-byte blocks; when finished
+// The Git encoding operates on 52-byte blocks; when finished
 // writing, the caller must Close the returned encoder to flush any
 // partially written blocks.
 func NewEncoder(w io.Writer) io.WriteCloser    { return &encoder{w: w} }
@@ -219,7 +219,7 @@ func (e *encoder) Close() os.Error {
        return e.err;
 }
 
-// NewDecoder returns a new GIT base85 stream decoder.
+// NewDecoder returns a new Git base85 stream decoder.
 func NewDecoder(r io.Reader) io.Reader { return &decoder{r: r} }
 
 type decoder struct {
index fd5d781a27125b948b5c9d4d4e870ee1db306580..63bf2cd74f32aad6badd585c65240cbf19698ee9 100644 (file)
@@ -25,16 +25,16 @@ func gitSHA1(data []byte) []byte {
        return h.Sum();
 }
 
-// BUG(rsc): The GIT binary delta format is not implemented, only GIT binary literals.
+// BUG(rsc): The Git binary delta format is not implemented, only Git binary literals.
 
-// GITBinaryLiteral represents a GIT binary literal diff.
-type GITBinaryLiteral struct {
+// GitBinaryLiteral represents a Git binary literal diff.
+type GitBinaryLiteral struct {
        OldSHA1 []byte; // if non-empty, the SHA1 hash of the original
        New     []byte; // the new contents
 }
 
 // Apply implements the Diff interface's Apply method.
-func (d *GITBinaryLiteral) Apply(old []byte) ([]byte, os.Error) {
+func (d *GitBinaryLiteral) Apply(old []byte) ([]byte, os.Error) {
        if sum := gitSHA1(old); !bytes.HasPrefix(sum, d.OldSHA1) {
                return nil, ErrPatchFailure
        }
@@ -67,8 +67,8 @@ func getHex(s []byte) (data []byte, rest []byte) {
        return;
 }
 
-// ParseGITBinary parses raw as a GIT binary patch.
-func ParseGITBinary(raw []byte) (Diff, os.Error) {
+// ParseGitBinary parses raw as a Git binary patch.
+func ParseGitBinary(raw []byte) (Diff, os.Error) {
        var oldSHA1, newSHA1 []byte;
        var sawBinary bool;
 
@@ -105,16 +105,16 @@ func ParseGITBinary(raw []byte) (Diff, os.Error) {
                        var buf [1]byte;
                        m, err := z.Read(&buf);
                        if m != 0 || err != os.EOF {
-                               return nil, os.NewError("GIT binary literal longer than expected")
+                               return nil, os.NewError("Git binary literal longer than expected")
                        }
 
                        if sum := gitSHA1(data); !bytes.HasPrefix(sum, newSHA1) {
-                               return nil, os.NewError("GIT binary literal SHA1 mismatch")
+                               return nil, os.NewError("Git binary literal SHA1 mismatch")
                        }
-                       return &GITBinaryLiteral{oldSHA1, data}, nil;
+                       return &GitBinaryLiteral{oldSHA1, data}, nil;
                }
                if !sawBinary {
-                       return nil, os.NewError("unexpected GIT patch header: " + string(first))
+                       return nil, os.NewError("unexpected Git patch header: " + string(first))
                }
        }
        panic("unreachable");
index 25f03fe6106b91600876a7bc6e20557a80a33f4e..81a2dfcfc435507caddd0da57b6acf83a4880347 100644 (file)
@@ -4,7 +4,7 @@
 
 // Package patch implements parsing and execution of the textual and
 // binary patch descriptions used by version control tools such as
-// CVS, GIT, Mercurial, and Subversion.
+// CVS, Git, Mercurial, and Subversion.
 package patch
 
 import (
@@ -70,7 +70,7 @@ var newline = []byte{'\n'}
 // Parse patches the patch text to create a patch Set.
 // The patch text typically comprises a textual header and a sequence
 // of file patches, as would be generated by CVS, Subversion,
-// Mercurial, or GIT.
+// Mercurial, or Git.
 func Parse(text []byte) (*Set, os.Error) {
        // Split text into files.
        // CVS and Subversion begin new files with
@@ -78,7 +78,7 @@ func Parse(text []byte) (*Set, os.Error) {
        //      ==================
        //      diff -u blah blah
        //
-       // Mercurial and GIT use
+       // Mercurial and Git use
        //      diff [--git] a/file/path b/file/path.
        //
        // First look for Index: lines.  If none, fall back on diff lines.
@@ -208,7 +208,7 @@ func Parse(text []byte) (*Set, os.Error) {
                                break;
                        }
                        if hasPrefix(l, "index ") || hasPrefix(l, "GIT binary patch") {
-                               diff, err := ParseGITBinary(oldraw);
+                               diff, err := ParseGitBinary(oldraw);
                                if err != nil {
                                        return nil, err
                                }