Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stg export errors out when exporting a series that contains an empty patch #112

Closed
agotsis opened this issue Jun 10, 2021 · 2 comments
Closed

Comments

@agotsis
Copy link

agotsis commented Jun 10, 2021

rep.sh

#!/bin/bash

set -ex
# cleanup
rm -rf test export

mkdir test export && cd test

echo "hello" > file.txt

git init && git add file.txt && git commit -m "Initial commit"

stg init

# create a non-empty patch
echo "world" >> file.txt
stg new p1 -m p1 && stg refresh

# create an empty patch
stg new p2 -m p2

# try to export the series
stg export -n -d ../export

## ERROR: ##
# error: unrecognized input
# stg export: git failed with code 128
# <choked on empty patch it seems>

## EXPECTED: ##
# <empty, patches exported>
$ ./rep.sh
+ rm -rf test export
+ mkdir test export
+ cd test
+ echo hello
+ git init
Initialized empty Git repository in /home/agotsis/test/.git/
+ git add file.txt
+ git commit -m 'Initial commit'
[master (root-commit) f1a0559] Initial commit
 1 file changed, 1 insertion(+)
 create mode 100644 file.txt
+ stg init
+ echo world
+ stg new p1 -m p1
Now at patch "p1"
+ stg refresh
Now at patch "p1"
+ stg new p2 -m p2
Now at patch "p2"
+ stg export -n -d ../export
error: unrecognized input
stg export: git failed with code 128

$ ls export
01-p1  series

$ cat export/series
# This series applies on GIT commit f1a055946ffd00b5ed04d3e76106e3544f6d718a
01-p1
02-p2
$ stg -v
Stacked GIT 1.1
git version 2.28.0
Python version 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0]

$ git --version
git version 2.28.0

It would also appear that an empty patch in the middle has the same issues.

@jpgrayson
Copy link
Collaborator

@agotsis thank you for this issue report. Turns out stg import also had an issue with importing empty patches, which is now also resolved.

@agotsis
Copy link
Author

agotsis commented Jun 14, 2021

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants