chiark / gitweb /
Merge branch 'stable'
authorKarl Hasselström <kha@treskal.com>
Tue, 26 Aug 2008 22:00:15 +0000 (00:00 +0200)
committerKarl Hasselström <kha@treskal.com>
Tue, 26 Aug 2008 22:00:15 +0000 (00:00 +0200)
Conflicts:
stgit/commands/diff.py
stgit/commands/edit.py
stgit/commands/export.py
stgit/commands/files.py
stgit/commands/mail.py
stgit/gitmergeonefile.py
t/t1200-push-modified.sh
t/t1201-pull-trailing.sh
t/test-lib.sh

1  2 
Documentation/tutorial.txt
examples/gitconfig
stgit/commands/pick.py
t/README
t/t1200-push-modified.sh
t/t1201-pull-trailing.sh
t/t1302-repair-interop.sh
t/t2702-refresh-rm.sh

index 6eaa623bf69fb475a0fa9256c68e822fd4b314e6,b040d290dabc003454f531cde7fb45f67bb7e848..5d2e50ab816e6589d189fcdff4e8620f3e3bac81
@@@ -32,7 -32,7 +32,7 @@@ Repository initialisatio
  -------------------------
  
  In stand-alone mode, StGIT is used in conjunction with a GIT repository
- that is already initialised (using 'git-init-db'). StGIT cannot be used
+ that is already initialised (using 'git init'). StGIT cannot be used
  outside of a GIT repository.
  Any branch in a GIT repository may be managed by StGIT. Each branch
  managed by StGIT contains an independent series of StGIT patches.
@@@ -123,22 -123,18 +123,22 @@@ You can view modified files that have a
    stg files
  
  The 'stg refresh' command automatically notes changes to files that
 -already exist in the working directory, but you have to tell StGIT
 -explicitly if you add, remove, or rename files.
 -To record the addition or deletion of files in your new patch:
 +already exist in the working directory (it also notices if you remove
 +them), but you have to tell StGIT explicitly if you add or rename a
 +file:
  
 -  stg add [<file>*]
 -  stg rm [<file>*]
 +  git add new-file
  
 -To record the renaming of a file in your new patch, issue both of these
 -commands:
 +to add a file, and
  
 -  stg rm <oldfilename>
 -  stg add <newfilename>
 +  mv old-file new-file
 +  git add new-file
 +
 +or simply
 +
 +  git mv old-file new-file
 +
 +to move a file.
  
  
  Stack manipulation: managing multiple patches
diff --combined examples/gitconfig
index 28d94af48d5677d5cdb05d559d6d8f7f909c30bf,b7a6629c60cfa8570d52b762d4b7e962f9b78f4b..4a362021860bac1293f240a4832cb844a7ed92cb
@@@ -19,7 -19,6 +19,7 @@@
        #autoresolved = no
  
        # SMTP server for sending patches
 +      #smtpserver = /usr/sbin/sendmail -t -i
        #smtpserver = localhost:25
  
        # Set to 'yes' to use SMTP over TLS
        #pager = filterdiff --annotate | colordiff | less -FRX
  
        # GIT pull and fetch commands (should take the same arguments as
-       # git-fetch or git-pull).  By default:
-       #pullcmd = git-pull
-       #fetchcmd = git-fetch
+       # git fetch or git pull).  By default:
+       #pullcmd = git pull
+       #fetchcmd = git fetch
  
        # Rebase command. Note that this command is internally implemented in
        # a different way. Only define this option if a different rebase
        # is needed (i.e. 'git svn rebase')
-       #rebasecmd = git-reset
+       #rebasecmd = git reset
  
        # "stg pull" policy.  This is the repository default, which can be
        # overriden on a per-branch basis using branch.*.stgit.pull-policy
        # To support local parent branches:
        #pull-policy = rebase
  
 -      # The three-way merge tool. Note that the 'output' file contains the
 -      # same data as 'branch1'. This is useful for tools that do not take an
 -      # output parameter
 -      #merger = diff3 -L current -L ancestor -L patched -m -E \
 -      #       \"%(branch1)s\" \"%(ancestor)s\" \"%(branch2)s\" \
 -      #       > \"%(output)s\"
 -
        # Interactive two/three-way merge tool. It is executed by the
        # 'resolved --interactive' command
        #i3merge = xxdiff --title1 current --title2 ancestor --title3 patched \
        # The maximum length of an automatically generated patch name
        #namelenth = 30
  
 +      # Extra options to pass to "git diff" (extend/override with
 +      # -O/--diff-opts). For example, -M turns on rename detection.
 +      #diff-opts = -M
 +
  [mail "alias"]
        # E-mail aliases used with the 'mail' command
        git = git@vger.kernel.org
diff --combined stgit/commands/pick.py
index 2a670e8523371fce6ccb17165fab1eef728cd6a0,add2a33b12a77adce5bb56d4ed380896778f8648..44b461e7f4a9ecbac9e859b2ed33fe91831eae02
@@@ -81,14 -81,14 +81,14 @@@ def __pick_commit(commit_id, patchname
      if options.fold:
          out.start('Folding commit %s' % commit_id)
  
-         # try a direct git-apply first
+         # try a direct git apply first
          if not git.apply_diff(bottom, top):
 -            git.merge(bottom, git.get_head(), top, recursive = True)
 +            git.merge_recursive(bottom, git.get_head(), top)
  
          out.done()
      elif options.update:
 -        rev1 = git_id(crt_series, '//bottom')
 -        rev2 = git_id(crt_series, '//top')
 +        rev1 = git_id(crt_series, 'HEAD^')
 +        rev2 = git_id(crt_series, 'HEAD')
          files = git.barefiles(rev1, rev2).split('\n')
  
          out.start('Updating with commit %s' % commit_id)
          patchname = newpatch.get_name()
  
          # find a patchlog to fork from
 -        (refpatchname, refbranchname, refpatchid) = parse_rev(patchname)
 -        if refpatchname and not refpatchid and \
 -               (not refpatchid or refpatchid == 'top'):
 -            # FIXME: should also support picking //top.old
 +        refbranchname, refpatchname = parse_rev(patchname)
 +        if refpatchname:
              if refbranchname:
                  # assume the refseries is OK, since we already resolved
                  # commit_str to a git_id
diff --combined t/README
index 757f8101669f6e17fa287f42124981734d76123c,ffb3c66e8d4cf72683f0fa056185ee1a50963bff..1e9510b76744ccdccb3d5ac8c0a337693e0ba454
+++ b/t/README
@@@ -22,11 -22,11 +22,11 @@@ The easiest way to run tests is to say 
  the tests.
  
      *** t0000-basic.sh ***
-     *   ok 1: .git/objects should be empty after git-init-db in an empty repo.
+     *   ok 1: .git/objects should be empty after git init in an empty repo.
      *   ok 2: .git/objects should have 256 subdirectories.
-     *   ok 3: git-update-index without --add should fail adding.
+     *   ok 3: git update-index without --add should fail adding.
      ...
-     *   ok 23: no diff after checkout and git-update-index --refresh.
+     *   ok 23: no diff after checkout and git update-index --refresh.
      * passed all 23 test(s)
      *** t0100-environment-names.sh ***
      *   ok 1: using old names should issue warnings.
@@@ -37,9 -37,9 +37,9 @@@ Or you can run each test individually f
  this:
  
      $ sh ./t3001-ls-files-killed.sh
-     *   ok 1: git-update-index --add to add various paths.
-     *   ok 2: git-ls-files -k to show killed files.
-     *   ok 3: validate git-ls-files -k output.
+     *   ok 1: git update-index --add to add various paths.
+     *   ok 2: git ls-files -k to show killed files.
+     *   ok 3: validate git ls-files -k output.
      * passed all 3 test(s)
  
  You can pass --verbose (or -v), --debug (or -d), and --immediate
@@@ -105,7 -105,7 +105,7 @@@ assignment to variable 'test_descriptio
        test_description='xxx test (option --frotz)
  
        This test registers the following structure in the cache
-       and tries to run git-ls-files with option --frotz.'
+       and tries to run git ls-files with option --frotz.'
  
  
  Source 'test-lib.sh'
@@@ -154,8 -154,8 +154,8 @@@ library for your script to use
     Example:
  
        test_expect_success \
-           'git-write-tree should be able to write an empty tree.' \
-           'tree=$(git-write-tree)'
+           'git write-tree should be able to write an empty tree.' \
+           'tree=$(git write-tree)'
  
   - test_expect_failure <message> <script>
  
     yields success, test is considered a failure.
  
     This should _not_ be used for tests that succeed when their
 -   commands fail -- use test_expect_success and shell negation (!) for
 -   that. test_expect_failure is for cases when a test is known to be
 -   broken.
 +   commands fail -- use test_expect_success and one of general_error,
 +   command_error, and conflict for that. test_expect_failure is for
 +   cases when a test is known to be broken.
  
   - test_debug <script>
  
diff --combined t/t1200-push-modified.sh
index 113e41d5e1c57c39a931bc36604d77539d3bba2f,647c20063b4ef49d18700ddef0739c61f133df58..35c9bdda24b09eeadfdcfce199eac97870f6a540
@@@ -23,11 -23,11 +23,11 @@@ test_expect_success 
      stg clone foo bar &&
      (
          cd bar && stg new p1 -m p1 &&
 -        printf "a\nc\n" > file && stg add file && stg refresh &&
 +        printf "a\nc\n" > file && git add file && stg refresh &&
          stg new p2 -m p2 &&
          printf "a\nb\nc\n" > file && stg refresh &&
 -        [ "$(echo $(stg applied))" = "p1 p2" ] &&
 -        [ "$(echo $(stg unapplied))" = "" ]
 +        [ "$(echo $(stg series --applied --noprefix))" = "p1 p2" ] &&
 +        [ "$(echo $(stg series --unapplied --noprefix))" = "" ]
      )
  '
  
@@@ -35,8 -35,8 +35,8 @@@ test_expect_success 
      'Port those patches to orig tree' '
      (
          cd foo &&
-         GIT_DIR=../bar/.git git-format-patch --stdout \
-           $(cd ../bar && stg id master:{base})..HEAD | git-am -3 -k
+         GIT_DIR=../bar/.git git format-patch --stdout \
 -          $(cd ../bar && stg id base@master)..HEAD | git am -3 -k
++          $(cd ../bar && stg id master:{base})..HEAD | git am -3 -k
      )
  '
  
@@@ -49,7 -49,7 +49,7 @@@ test_expect_success 
  
  test_expect_success \
      'Attempt to push the first of those patches without --merged' \
 -    "(cd bar && ! stg push
 +    "(cd bar && conflict_old stg push
       )
  "
  
@@@ -57,8 -57,8 +57,8 @@@ test_expect_success 
      'Rollback the push' '
      (
          cd bar && stg push --undo &&
 -        [ "$(echo $(stg applied))" = "" ] &&
 -        [ "$(echo $(stg unapplied))" = "p1 p2" ]
 +        [ "$(echo $(stg series --applied --noprefix))" = "" ] &&
 +        [ "$(echo $(stg series --unapplied --noprefix))" = "p1 p2" ]
      )
  '
  
@@@ -66,8 -66,8 +66,8 @@@ test_expect_success 
      'Push those patches while checking they were merged upstream' '
      (
          cd bar && stg push --merged --all
 -        [ "$(echo $(stg applied))" = "p1 p2" ] &&
 -        [ "$(echo $(stg unapplied))" = "" ]
 +        [ "$(echo $(stg series --applied --noprefix))" = "p1 p2" ] &&
 +        [ "$(echo $(stg series --unapplied --noprefix))" = "" ]
      )
  '
  
diff --combined t/t1201-pull-trailing.sh
index 8a748737b4cab3b66ef3dffec18035645a8dd45d,805e805c9cd34e231a711f899a9a2d2b38b0e806..3a7efc1f434e40fb703a30963602c375363e876d
@@@ -29,9 -29,9 +29,9 @@@ test_expect_success 
  test_expect_success \
      'Port those patches to orig tree' \
      '(cd foo &&
-       GIT_DIR=../bar/.git git-format-patch --stdout \
+       GIT_DIR=../bar/.git git format-patch --stdout \
 -          $(cd ../bar && stg id base@master)..HEAD |
 +          $(cd ../bar && stg id master:{base})..HEAD |
-       git-am -3 -k
+       git am -3 -k
       )
      '
  
@@@ -55,7 -55,7 +55,7 @@@ test_expect_success 
  
  test_expect_success \
      'Check that all went well' \
 -    "diff -u foo/file bar/file
 +    "test_cmp foo/file bar/file
  "
  
  test_done
index 224c4bad5b7e4a70b036c82df5e8def1a609bece,910b23abf589997b5d05167ec9ae7e0abb8c99d4..9fad3fa892b72b8b32548df00917cee46d82939f
@@@ -21,39 -21,39 +21,39 @@@ test_expect_success 'Create five patche
      for i in 0 1 2 3 4; do
          stg new p$i -m p$i;
      done &&
 -    [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4" ] &&
 -    [ "$(echo $(stg unapplied))" = "" ]
 +    [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2 p3 p4" ] &&
 +    [ "$(echo $(stg series --unapplied --noprefix))" = "" ]
  '
  
- test_expect_success 'Pop two patches with git-reset' '
+ test_expect_success 'Pop two patches with git reset' '
      git reset --hard HEAD~2 &&
 -    ! stg refresh &&
 +    command_error stg refresh &&
      stg repair &&
      stg refresh &&
 -    [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
 -    [ "$(echo $(stg unapplied))" = "p3 p4" ]
 +    [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2" ] &&
 +    [ "$(echo $(stg series --unapplied --noprefix))" = "p3 p4" ]
  '
  
  test_expect_success 'Create a new patch' '
      stg new q0 -m q0 &&
 -    [ "$(echo $(stg applied))" = "p0 p1 p2 q0" ] &&
 -    [ "$(echo $(stg unapplied))" = "p3 p4" ]
 +    [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2 q0" ] &&
 +    [ "$(echo $(stg series --unapplied --noprefix))" = "p3 p4" ]
  '
  
- test_expect_success 'Go to an unapplied patch with with git-reset' '
+ test_expect_success 'Go to an unapplied patch with with git reset' '
      git reset --hard $(stg id p3) &&
 -    ! stg refresh &&
 +    command_error stg refresh &&
      stg repair &&
      stg refresh &&
 -    [ "$(echo $(stg applied))" = "p0 p1 p2 p3" ] &&
 -    [ "$(echo $(stg unapplied))" = "q0 p4" ]
 +    [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2 p3" ] &&
 +    [ "$(echo $(stg series --unapplied --noprefix))" = "q0 p4" ]
  '
  
- test_expect_success 'Go back to below the stack base with git-reset' '
+ test_expect_success 'Go back to below the stack base with git reset' '
      git reset --hard foo-tag &&
      stg repair &&
 -    [ "$(echo $(stg applied))" = "" ] &&
 -    [ "$(echo $(stg unapplied))" = "p0 p1 p2 p3 q0 p4" ]
 +    [ "$(echo $(stg series --applied --noprefix))" = "" ] &&
 +    [ "$(echo $(stg series --unapplied --noprefix))" = "p0 p1 p2 p3 q0 p4" ]
  '
  
  test_done
diff --combined t/t2702-refresh-rm.sh
index 896ebf39e2bcc7a10f3a4494ef5fd1a81db262a7,0000000000000000000000000000000000000000..0362cc60211c775723b51d3dfcb6734e37552016
mode 100755,000000..100755
--- /dev/null
@@@ -1,101 -1,0 +1,101 @@@
- test_expect_success 'git-rm a file' '
 +#!/bin/sh
 +
 +test_description='"stg refresh" with removed files'
 +
 +. ./test-lib.sh
 +
 +# Ignore our own temp files.
 +cat >> .git/info/exclude <<EOF
 +expected*.txt
 +files*.txt
 +status*.txt
 +EOF
 +
 +reset () {
 +    stg pop -a > /dev/null
 +    git reset --hard > /dev/null
 +}
 +
 +test_expect_success 'Initialize StGit stack' '
 +    stg init &&
 +    echo x > x.txt &&
 +    echo y > y.txt &&
 +    git add x.txt y.txt &&
 +    git commit -m "Add some files"
 +'
 +
 +cat > expected0.txt <<EOF
 +D y.txt
 +EOF
 +printf '' > expected1.txt
- test_expect_success 'git-rm a file together with other changes' '
++test_expect_success 'git rm a file' '
 +    stg new -m p0 &&
 +    git rm y.txt &&
 +    stg status > status0.txt &&
 +    test_cmp expected0.txt status0.txt &&
 +    stg refresh &&
 +    stg status > status1.txt &&
 +    test_cmp expected1.txt status1.txt &&
 +    stg files | sort > files.txt &&
 +    test_cmp expected0.txt files.txt
 +'
 +
 +reset
 +
 +cat > expected0.txt <<EOF
 +D y.txt
 +M x.txt
 +EOF
 +printf '' > expected1.txt
++test_expect_success 'git rm a file together with other changes' '
 +    stg new -m p1 &&
 +    echo x2 >> x.txt &&
 +    git rm y.txt &&
 +    stg status > status0.txt &&
 +    test_cmp expected0.txt status0.txt &&
 +    stg refresh &&
 +    stg status > status1.txt &&
 +    test_cmp expected1.txt status1.txt &&
 +    stg files | sort > files.txt &&
 +    test_cmp expected0.txt files.txt
 +'
 +
 +reset
 +
 +cat > expected0.txt <<EOF
 +D y.txt
 +EOF
 +printf '' > expected1.txt
 +test_expect_success 'rm a file' '
 +    stg new -m p2 &&
 +    rm y.txt &&
 +    stg status > status0.txt &&
 +    test_cmp expected0.txt status0.txt &&
 +    stg refresh &&
 +    stg status > status1.txt &&
 +    test_cmp expected1.txt status1.txt &&
 +    stg files | sort > files.txt &&
 +    test_cmp expected0.txt files.txt
 +'
 +
 +reset
 +
 +cat > expected0.txt <<EOF
 +D y.txt
 +M x.txt
 +EOF
 +printf '' > expected1.txt
 +test_expect_success 'rm a file together with other changes' '
 +    stg new -m p3 &&
 +    echo x2 >> x.txt &&
 +    rm y.txt &&
 +    stg status > status0.txt &&
 +    test_cmp expected0.txt status0.txt &&
 +    stg refresh &&
 +    stg status > status1.txt &&
 +    test_cmp expected1.txt status1.txt &&
 +    stg files | sort > files.txt &&
 +    test_cmp expected0.txt files.txt
 +'
 +
 +test_done