git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-bundle: assorted fixes

From
Mark Levedahl <mdl123@verizon.net>
Date
Feb 23, 2007, 01:36 UTC
Message-ID
<45DE4507.7090206@verizon.net>
In-Reply-To
<Pine.LNX.4.63.0702221913250.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:

I built this under cygwin, it is running but I find two regressions compared to my git-bundle.sh:

1) git bundle create --all  <whatever> does not record any references, 
while it should record all references (heads and tags). From shell, this 
requires use of both git-rev-parse and git-show-ref:
    gitrevargs=$(git-rev-parse --symbolic --revs-only $args) || exit 1
    # find the refs to carry along and get sha1s for each.
    refs=
    fullrevargs=
    for arg in $gitrevargs ; do
        #ignore options and basis refs, get full ref name for things
        # we will transport rejecting anything ambiguous (e.g., user
        # gives master, have heads/master and remotes/origin/master, we
        # keep the former).
        case "$arg" in
            -* | ^*) fullrevargs="$fullrevargs $arg";;
            *)  ref=$(git-show-ref "$arg")
                test "$(echo $ref | wc -w)" = "2" || die "Ambigous 
reference: $arg
$ref"
                fullrevargs="$fullrevargs ${ref#* }"
                refs="$refs $ref";;
        esac
    done
2) git bundle verify  reports only a single sha1 if prerequisites are 
not met. git-bundle.sh would loop through finding each missing one, 
annotating with the one line commit message. The prerequisites were 
stored using:
    (for p in $prereqs ; do
        git-rev-list --pretty=one --max-count=1 $p
    done) > "$prerequisites"
and then verify does:
    test -z "$prereqs" && return 0
    bad=$(echo "$prereqs" | cut -b-40 | git-rev-list --stdin --not --all 
2>&1)
    if test -n "$bad" ; then
        test "$1" = "--silent" && return 1
        echo "error: $bfile requires the following commits you lack:"
        echo "$prereqs" |
        while read sha1 comment ; do
            missing=$(git-rev-list $sha1 --not --all 2>&1)
            test -n "$missing" && echo "$sha1 $comment"
        done
        exit 1
    fi
    return 0
The difference is
    fatal: bad object 59e4aa84d4b4f7c6393317c68649ef7db3c4440c
    error: At least one prerequisite is lacking.
vs.
    error: /home/mlevedahl/bundle2 requires the following commits you lack:
    59e4aa84d4b4f7c6393317c68649ef7db3c4440c Merge remote branch 
'rvaas05/gem.418' into lcb.418
    8eb8c8274c28be9435da8534f8bb598503f4f85a Merge remote branch 
'rvaas05/gem.418' into lcd.419

This was Junio's suggestion originally, and I think it a very good one. The latter error message is far more helpful to some poor soul trying to fix a problem.

Also,  I did track down the issue that forced me to use tar (or at least 
*some* archiver) in cygwin: it is a known bug without a planned fix that 
precludes saving mixed text and binary in one file from bash, and seems 
to be tied deeply into bash, fork, and pipes. Basically, doing
    echo "some text data" > file
    echo "some binary data" >>file
is totally confused as the underlying pipe / fork mechanism thinks file 
is text mode on the second operation. This happens regardless of mount 
mode or CYGWIN=binmode. The end result is under bash the binary data 
unconditionally suffers crlf->lf translation. You can look at at 
http://www.mail-archive.com/cygwin@cygwin.com/msg76319.html for more 
information.
Mark
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 24 of 28 in “Add git-bundle: move objects and references by archive”
  1. Add git-bundle: move objects and references by archiveJohannes Schindelin, Feb 22, 2007
  2. Nicolas PitreFeb 22, 2007
  3. Johannes SchindelinFeb 22, 2007
  4. Simon 'corecode' SchubertFeb 22, 2007
  5. Nicolas PitreFeb 22, 2007
  6. Johannes SchindelinFeb 22, 2007
  7. Simon 'corecode' SchubertFeb 22, 2007
  8. Johannes SchindelinFeb 22, 2007
  9. Nicolas PitreFeb 22, 2007
  10. Johannes SchindelinFeb 22, 2007
  11. Nicolas PitreFeb 22, 2007
  12. Junio C HamanoFeb 22, 2007
  13. Junio C HamanoFeb 22, 2007
  14. Johannes SchindelinFeb 22, 2007
  15. Junio C HamanoFeb 22, 2007
  16. Johannes SchindelinFeb 22, 2007
  17. Junio C HamanoFeb 22, 2007
  18. Johannes SchindelinFeb 22, 2007
  19. Johannes SchindelinFeb 22, 2007
  20. Mark LevedahlFeb 23, 2007
  21. Junio C HamanoFeb 23, 2007
  22. Johannes SixtFeb 22, 2007
  23. git-bundle: assorted fixesJohannes Schindelin, Feb 22, 2007
  24. Mark LevedahlFeb 23, 2007
  25. Johannes SchindelinFeb 23, 2007
  26. Mark LevedahlFeb 23, 2007
  27. Johannes SchindelinFeb 23, 2007
  28. Mark LevedahlFeb 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.