Re: [PATCH v2 2/2] git-p4: fix Git LFS pointer parsing

2016-04-22 Thread Sebastian Schuberth
On Fri, Apr 22, 2016 at 9:53 AM, Lars Schneider wrote: > What would be the best way forward? A v3 with a better commit message > mentioning the array -> string change? I'd vote for that, yes. Also v3 could then properly incorporate my regexp. -- Sebastian Schuberth -- To unsubscribe from this

Re: [PATCH v2 2/2] git-p4: fix Git LFS pointer parsing

2016-04-22 Thread Lars Schneider
> On 20 Apr 2016, at 23:01, Junio C Hamano wrote: > > larsxschnei...@gmail.com writes: > >> -pointerContents = [i+'\n' for i in pointerFile.split('\n')[2:][:-1]] pointerFile was split here by '\n'. The splitting removes the newline and the i+'\n' adds it again. This back and forth makes

Re: [PATCH v2 2/2] git-p4: fix Git LFS pointer parsing

2016-04-20 Thread Junio C Hamano
larsxschnei...@gmail.com writes: > -pointerContents = [i+'\n' for i in pointerFile.split('\n')[2:][:-1]] > -oid = pointerContents[1].split(' ')[1].split(':')[1][:-1] > + > +# Git LFS removed the preamble in the output of the 'pointer' command > +# starting from vers

Re: [PATCH v2 2/2] git-p4: fix Git LFS pointer parsing

2016-04-20 Thread Lars Schneider
On 20 Apr 2016, at 20:30, Junio C Hamano wrote: > Sebastian Schuberth writes: > >> Why do we need to remove the preamble at all, if present? Because I need the content of a valid Git LFS pointer file a few lines below: https://github.com/larsxschneider/git/blob/5ee7601c49b6eaa9da5eb47db5cf12

Re: [PATCH v2 2/2] git-p4: fix Git LFS pointer parsing

2016-04-20 Thread Junio C Hamano
Sebastian Schuberth writes: > Why do we need to remove the preamble at all, if present? If all we > want is the oid, we should simply only look at the line that starts > with that keyword, which would skip any preamble. Which is what you > already do here. However, I'd probably use .splitlines()

Re: [PATCH v2 2/2] git-p4: fix Git LFS pointer parsing

2016-04-20 Thread Sebastian Schuberth
On Wed, Apr 20, 2016 at 10:10 AM, wrote: > --- a/git-p4.py > +++ b/git-p4.py > @@ -1064,8 +1064,17 @@ class GitLFS(LargeFileSystem): > if pointerProcess.wait(): > os.remove(contentFile) > die('git-lfs pointer command failed. Did you install the > extension?')

[PATCH v2 2/2] git-p4: fix Git LFS pointer parsing

2016-04-20 Thread larsxschneider
From: Lars Schneider Git LFS 1.2.0 removed a preamble from the output of the 'git lfs pointer' command [1] which broke the parsing of this output. Adjust the parser to support the old and the new format. [1] https://github.com/github/git-lfs/commit/da2935d9a739592bc775c98d8ef4df9c72ea3b43 Sign