Re: [PATCH/v2] git-basis, a script to manage bases for git-bundle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:


Well, I have a moderately strong objection to this.

This very much feels like adding a missing feature to "git bundle" command
itself.  Why isn't it a new option to it?


I have implemented (in script form) a different approach: basically, I just keep a local copy of the refs pushed out via bundle in refs/remotes/*, just as for any other remote, and then use those as the basis for later bundles. My longer term goal is to integrate this into git push, so that with a properly configured remote "git push foo" will create a bundle based upon the local knowledge of the remote's basis and update the local copy of the refs.


For reference, this is the script I currently use ...

#!/bin/sh
# usage
if test $# -lt 4
then
    echo "usage: $0 repoDirectory bundleName remote [git-for-each-ref args]"
    exit 1
fi

# must be at toplevel
cd $1 || exit 1
cd ./$(git rev-parse --show-cdup) || exit 1

bundleName=$2
remote=$3
shift 3

# get list of what we want to bundle up
newrefs=$(git for-each-ref --format="%(refname)" $*)

# get list of the current bundle
basis=$(git for-each-ref --format="^%(objectname)" refs/remotes/$remote)

# create the bundle
if git bundle create "$bundleName" $newrefs $basis
then
    # update our record of basis from the bundle
    git bundle list-heads "$bundleName" | \
    while read sha1 refname
    do
        git update-ref refs/remotes/"$remote"/"${refname##refs/}" $sha1
    done
else
    rm -f "$bundleName"
fi

Mark

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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux