# [PATCH 4/4] Fix a typo in the "add" command's documentation

5 messages from 2005-11-14 to 2005-11-14. Participants: Chuck Lever.
Thread: https://gitlist.dev/t/2504

## Chuck Lever, 2005-11-14 16:50

Subject: [PATCH 0/4] StGIT minor clean ups
Message-ID: <20051114165007.22202.69803.stgit@dexter.citi.umich.edu>
URL: https://gitlist.dev/e/20051114165007.22202.69803.stgit%40dexter.citi.umich.edu

```
A few minor typos and additional error checking.

        -- Chuck Lever
--
corporate:    <cel at netapp dot com>
personal:     <chucklever at bigfoot dot com>

```

## Chuck Lever, 2005-11-14 16:50

Subject: [PATCH 1/4] Better error message when renaming patches to same name
Message-ID: <20051114165055.22202.28533.stgit@dexter.citi.umich.edu>
URL: https://gitlist.dev/e/20051114165055.22202.28533.stgit%40dexter.citi.umich.edu
In-Reply-To: <20051114165007.22202.69803.stgit@dexter.citi.umich.edu>

```
Generate a more precise error message when trying to rename a patch to the
same name.  This is what we get currently:

  [cel@dexter main]$ stg rename nfs_direct_wait nfs_direct_wait
  Renaming patch "nfs_direct_wait" -> "nfs_direct_wait"...stg rename: Patch
  "nfs_direct_wait" already exists

  [cel@dexter main]$

Signed-off-by: Chuck Lever <cel@netapp.com>
---

 stgit/stack.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/stgit/stack.py b/stgit/stack.py
index 1ffeaee..0907b37 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -775,6 +775,9 @@ class Series:
         applied = self.get_applied()
         unapplied = self.get_unapplied()
 
+        if oldname == newname:
+            raise StackException, '"To" name and "from" name are the same'
+
         if newname in applied or newname in unapplied:
             raise StackException, 'Patch "%s" already exists' % newname
 

```

## Chuck Lever, 2005-11-14 16:50

Subject: [PATCH 2/4] use "crt_series.get_branch()" instead of "git.get_head_file()"
Message-ID: <20051114165057.22202.82090.stgit@dexter.citi.umich.edu>
URL: https://gitlist.dev/e/20051114165057.22202.82090.stgit%40dexter.citi.umich.edu
In-Reply-To: <20051114165007.22202.69803.stgit@dexter.citi.umich.edu>

```
More cleanup to the branch command.

Signed-off-by: Chuck Lever <cel@netapp.com>
---

 stgit/commands/branch.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/stgit/commands/branch.py b/stgit/commands/branch.py
index d85ba69..9bf6cdb 100644
--- a/stgit/commands/branch.py
+++ b/stgit/commands/branch.py
@@ -147,7 +147,7 @@ def func(parser, options, args):
     elif options.protect:
 
         if len(args) == 0:
-            branch_name = git.get_head_file()
+            branch_name = crt_series.get_branch()
         elif len(args) == 1:
             branch_name = args[0]
         else:
@@ -182,7 +182,7 @@ def func(parser, options, args):
     elif options.unprotect:
 
         if len(args) == 0:
-            branch_name = git.get_head_file()
+            branch_name = crt_series.get_branch()
         elif len(args) == 1:
             branch_name = args[0]
         else:
@@ -222,4 +222,4 @@ def func(parser, options, args):
     if len(args) != 0:
         parser.error('incorrect number of arguments')
 
-    print git.get_head_file()
+    print crt_series.get_branch()

```

## Chuck Lever, 2005-11-14 16:50

Subject: [PATCH 3/4] Fix a typo in "stg pick"
Message-ID: <20051114165059.22202.93316.stgit@dexter.citi.umich.edu>
URL: https://gitlist.dev/e/20051114165059.22202.93316.stgit%40dexter.citi.umich.edu
In-Reply-To: <20051114165007.22202.69803.stgit@dexter.citi.umich.edu>

```
"Unknown" is misspelled.

Signed-off-by: Chuck Lever <cel@netapp.com>
---

 stgit/commands/pick.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stgit/commands/pick.py b/stgit/commands/pick.py
index 3c52a49..c01c799 100644
--- a/stgit/commands/pick.py
+++ b/stgit/commands/pick.py
@@ -64,7 +64,7 @@ def func(parser, options, args):
         elif len(patch_branch) == 2:
             patch = patch_branch[0]
         else:
-            raise CmdException, 'Unkown patch name'
+            raise CmdException, 'Unknown patch name'
 
     commit_id = git_id(commit_str)
     commit = git.Commit(commit_id)

```

## Chuck Lever, 2005-11-14 16:51

Subject: [PATCH 4/4] Fix a typo in the "add" command's documentation
Message-ID: <20051114165101.22202.91257.stgit@dexter.citi.umich.edu>
URL: https://gitlist.dev/e/20051114165101.22202.91257.stgit%40dexter.citi.umich.edu
In-Reply-To: <20051114165007.22202.69803.stgit@dexter.citi.umich.edu>

```
Signed-off-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Chuck Lever <cel@netapp.com>
---

 stgit/commands/add.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stgit/commands/add.py b/stgit/commands/add.py
index 999ce2b..fc9c5a7 100644
--- a/stgit/commands/add.py
+++ b/stgit/commands/add.py
@@ -27,7 +27,7 @@ from stgit import stack, git
 help = 'add files or directories to the repository'
 usage = """%prog [options] <files/dirs...>
 
-Add a the files or directories passed as arguments to the
+Add the files or directories passed as arguments to the
 repository. When a directory name is given, all the files and
 subdirectories are recursively added."""
 

```
