[PATCH v5 00/10] transport-helper: updates

2013-10-31 Thread Felipe Contreras
Hi,

Here are the patches that allow transport helpers to be completely transparent;
renaming branches, deleting them, custom refspecs, --force, --dry-run,
reporting forced update, everything works.

Some of these were were sent before and rejected without a reason, but here
they are again in case anybody is interested.

Diff from v3:

diff --git a/Documentation/gitremote-helpers.txt 
b/Documentation/gitremote-helpers.txt
index f1f4ca9..e75699c 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -437,6 +437,10 @@ set by Git if the remote helper has the 'option' 
capability.
 'option check-connectivity' \{'true'|'false'\}::
Request the helper to check connectivity of a clone.
 
+'option force' \{'true'|'false'\}::
+   Request the helper to perform a force update.  Defaults to
+   'false'.
+
 SEE ALSO
 
 linkgit:git-remote[1]
diff --git a/git-remote-testgit.sh b/git-remote-testgit.sh
index 6d2f282..716aa4c 100755
--- a/git-remote-testgit.sh
+++ b/git-remote-testgit.sh
@@ -39,6 +39,7 @@ do
fi
test -n $GIT_REMOTE_TESTGIT_SIGNED_TAGS  echo signed-tags
test -n $GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE  echo 
no-private-update
+   echo 'option'
echo
;;
list)
@@ -93,6 +94,7 @@ do
before=$(git for-each-ref --format=' %(refname) %(objectname) ')
 
git fast-import \
+   ${force:+--force} \
${testgitmarks:+--import-marks=$testgitmarks} \
${testgitmarks:+--export-marks=$testgitmarks} \
--quiet
@@ -115,6 +117,20 @@ do
 
echo
;;
+   option\ *)
+   read cmd opt val -EOF
+   $line
+   EOF
+   case $opt in
+   force)
+   test $val = true  force=true || force=
+   echo ok
+   ;;
+   *)
+   echo unsupported
+   ;;
+   esac
+   ;;
'')
exit
;;
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index be543c0..c667965 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -102,6 +102,19 @@ test_expect_success 'push delete branch' '
 rev-parse --verify refs/heads/new-name
 '
 
+test_expect_success 'forced push' '
+   (cd local 
+   git checkout -b force-test 
+   echo content  file 
+   git commit -a -m eight 
+   git push origin force-test 
+   echo content  file 
+   git commit -a --amend -m eight-modified 
+   git push --force origin force-test
+   ) 
+   compare_refs local refs/heads/force-test server refs/heads/force-test
+'
+
 test_expect_success 'cloning without refspec' '
GIT_REMOTE_TESTGIT_REFSPEC= \
git clone testgit::${PWD}/server local2 2error 

Felipe Contreras (10):
  transport-helper: fix extra lines
  transport-helper: don't update refs in dry-run
  transport-helper: add 'force' to 'export' helpers
  transport-helper: check for 'forced update' message
  fast-export: improve argument parsing
  fast-export: add new --refspec option
  transport-helper: add support for old:new refspec
  fast-import: add support to delete refs
  fast-export: add support to delete refs
  transport-helper: add support to delete branches

 Documentation/git-fast-export.txt   |  4 
 Documentation/git-fast-import.txt   |  3 +++
 Documentation/gitremote-helpers.txt |  4 
 builtin/fast-export.c   | 47 -
 fast-import.c   | 13 +++---
 git-remote-testgit.sh   | 16 +
 t/t5801-remote-helpers.sh   | 23 +-
 t/t9300-fast-import.sh  | 18 ++
 t/t9350-fast-export.sh  | 18 ++
 transport-helper.c  | 47 +
 10 files changed, 173 insertions(+), 20 deletions(-)

-- 
1.8.4.2+fc1

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 00/10] transport-helper: updates

2013-10-31 Thread Max Horn

On 31.10.2013, at 10:36, Felipe Contreras felipe.contre...@gmail.com wrote:

 Hi,
 
 Here are the patches that allow transport helpers to be completely 
 transparent;
 renaming branches, deleting them, custom refspecs, --force, --dry-run,
 reporting forced update, everything works.

I looked through this patch series in detail, and it looks fine to me. Indeed, 
it fixes several nuisances when using remote-helpers, and as such would be a 
definite win. In other words: Would be really nice to see these applied!


Cheers,
Max



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [PATCH v5 00/10] transport-helper: updates

2013-10-31 Thread Junio C Hamano
Max Horn m...@quendi.de writes:

 On 31.10.2013, at 10:36, Felipe Contreras felipe.contre...@gmail.com
 wrote:

 Hi,
 
 Here are the patches that allow transport helpers to be completely
 transparent;
 renaming branches, deleting them, custom refspecs, --force,
 --dry-run,
 reporting forced update, everything works.

 I looked through this patch series in detail, and it looks fine to
 me. Indeed, it fixes several nuisances when using remote-helpers, and
 as such would be a definite win.

Nice.

 In other words: Would be really nice to see these applied!

The series is sitting on the 'pu' branch, and I think there were
some fixup suggestions during the review, so it may need to be
rerolled before advancing to 'next'.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 00/10] transport-helper: updates

2013-10-31 Thread Felipe Contreras
On Thu, Oct 31, 2013 at 12:10 PM, Junio C Hamano gits...@pobox.com wrote:
 Max Horn m...@quendi.de writes:

 In other words: Would be really nice to see these applied!

 The series is sitting on the 'pu' branch, and I think there were
 some fixup suggestions during the review, so it may need to be
 rerolled before advancing to 'next'.

The suggestions are applied, as you can see in the diff.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 00/10] transport-helper: updates

2013-10-31 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes:

 Max Horn m...@quendi.de writes:

 On 31.10.2013, at 10:36, Felipe Contreras felipe.contre...@gmail.com
 wrote:

 Hi,
 
 Here are the patches that allow transport helpers to be completely
 transparent;
 renaming branches, deleting them, custom refspecs, --force,
 --dry-run,
 reporting forced update, everything works.

 I looked through this patch series in detail, and it looks fine to
 me. Indeed, it fixes several nuisances when using remote-helpers, and
 as such would be a definite win.

 Nice.

 In other words: Would be really nice to see these applied!

 The series is sitting on the 'pu' branch, and I think there were
 some fixup suggestions during the review, so it may need to be
 rerolled before advancing to 'next'.

Ah, I spoke too early; this is v5, updated from v4.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 00/10] transport-helper: updates

2013-10-31 Thread Max Horn

On 31.10.2013, at 19:10, Junio C Hamano gits...@pobox.com wrote:

 Max Horn m...@quendi.de writes:
 
 On 31.10.2013, at 10:36, Felipe Contreras felipe.contre...@gmail.com
 wrote:
 
 Hi,
 
 Here are the patches that allow transport helpers to be completely
 transparent;
 renaming branches, deleting them, custom refspecs, --force,
 --dry-run,
 reporting forced update, everything works.
 
 I looked through this patch series in detail, and it looks fine to
 me. Indeed, it fixes several nuisances when using remote-helpers, and
 as such would be a definite win.
 
 Nice.
 
 In other words: Would be really nice to see these applied!
 
 The series is sitting on the 'pu' branch, and I think there were
 some fixup suggestions during the review, so it may need to be
 rerolled before advancing to 'next'.

You are of course right. Next time I comment, I'll make sure to check whether 
previous review suggestions have been picked up.



signature.asc
Description: Message signed with OpenPGP using GPGMail