Your message dated Wed, 5 Sep 2018 20:44:34 +0100
with message-id <20180905194434.GA14231@blodeuwedd>
and subject line Dulwich now writes reflogs
has caused the Debian Bug report #688354,
regarding [python-dulwich] git stash fails after adding the root commit with 
dulwich
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
688354: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688354
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-dulwich
Version: 0.8.5-2
Severity: normal

Executing the following sequence:
- git init
- updating refs/heads/master from dulwich
- git stash
ends up in a failed stashing.

More precisely, the following code fails, with the message shown in comment.

#!/usr/bin/python

# -*- coding: UTF-8 -*-

import os

import time

import dulwich

def git_commit_tree(repo, ref, tree):

    new_commit = dulwich.objects.Commit()

    new_commit.tree = tree.id

    if ref in repo:

        new_commit.parents = [repo[ref].id]

    else:

        new_commit.parents = []

    config = repo.get_config_stack()

    author = '{}<{}>'.format(config.get('user', 'name'), config.get('user', 
'email'))

    new_commit.author = new_commit.committer = author

    new_commit.commit_time = new_commit.author_time = int(time.time())

    if time.daylight == 1:

        new_commit.commit_timezone = \

            new_commit.author_timezone = - time.altzone

    else:

        new_commit.commit_timezone = \

            new_commit.author_timezone = - time.timezone

    new_commit.encoding = "UTF-8"

    new_commit.message = 'Generated'

    repo.object_store.add_object(new_commit)

    repo.refs[ref] = new_commit.id

os.system('git init /tmp/dulwich-bug-repo')

# Returns:

#

# Initialized empty Git repository in /tmp/dulwich-bug-repo/.git/

repo = dulwich.repo.Repo('/tmp/dulwich-bug-repo')

blob = dulwich.objects.Blob.from_string('blob content')

repo.object_store.add_object(blob)

tree = dulwich.objects.Tree()

tree.add('f', 0100644, blob.id)

repo.object_store.add_object(tree)

git_commit_tree(repo, 'refs/heads/master', tree)

os.chdir('/tmp/dulwich-bug-repo')

os.system('git status')

# Returns:

#

# # On branch master

# # Changes to be committed:

# #   (use "git reset HEAD<file>..." to unstage)

# #

# #    deleted:    f

# #

os.system('git stash')

# Returns:

#

# /usr/lib/git-core/git-stash: line 232: 
/tmp/dulwich-bug-repo/.git/logs/refs/stash: No such file or directory


since the commit code is more or less taken from the tutorial http://www.samba.org/~jelmer/dulwich/docs/tutorial/object-store.html I suppose that the repository should be left in a consistent state after that execution, no?



--- System information. ---
Architecture: amd64
Kernel: Linux 3.2.0-3-amd64

Debian Release: wheezy/sid
990 unstable ftp.fr.debian.org
500 testing ftp.fr.debian.org
500 stable ftp.fr.debian.org
1 experimental ftp.fr.debian.org

--- Package information. ---
Depends (Version) | Installed
===========================-+-==============
python2.7 | 2.7.3-5
OR python2.6 | 2.6.8-0.2
python (>= 2.6.6-7~) | 2.7.3-2
python (<< 2.8) | 2.7.3-2
libc6 (>= 2.2.5) |


Recommends (Version) | Installed
================================-+-===========
python-fastimport | 0.9.2-1


Suggests (Version) | Installed
=================================-+-===========
python-dulwich-dbg |

--- End Message ---
--- Begin Message ---
Version: 0.19.0-1

As of version 0.19.0, Dulwich writes reflogs and this bug issues
should now be addressed.


-- 
Jelmer Vernooij <[email protected]>
PGP Key: https://www.jelmer.uk/D729A457.asc

Attachment: signature.asc
Description: PGP signature


--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to