nwb-extensions / ndx-template

A template for creating Neurodata Extensions for the NWB neurophysiology data standard
https://nwb.org/
Other
5 stars 8 forks source link

Does not work out of the box due to "left over conflict markers" error from git #48

Closed t-b closed 4 years ago

t-b commented 4 years ago

repo version: 65ce598f (Update setup.py, 2020-03-12)

$git --version
git version 2.26.0
$lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

After executing cookiecutter gh:nwb-extensions/ndx-template using default values I get

$cookiecutter gh:nwb-extensions/ndx-template
You've downloaded /home/firma/.cookiecutters/ndx-template before. Is it okay to delete and re-download it? [yes]:
namespace [ndx-my-namespace]:
description [An NWB:N extension]:
author [My Name]:
email [my_email@example.com]:
github_username [myname]:
copyright [2020, My Name]:
version [0.1.0]:
release [alpha]:
license [BSD 3-Clause]:
py_pkg_name [ndx_my_namespace]:
------------------------------------------------------------------

Finished: An initial directory structure has been created.

You should now populate your master file /home/firma/devel/test/ndx-my-namespace/docs/source/index.rst and create other documentation
source files. Use the Makefile to build the docs, like so:
   make builder
where "builder" is one of the supported builders, e.g. html, latex or linkcheck.

Cleaning file /home/firma/devel/test/ndx-my-namespace/docs/source/conf.py
Creating file /home/firma/devel/test/ndx-my-namespace/docs/source/_static/theme_overrides.css
Updating file /home/firma/devel/test/ndx-my-namespace/docs/source/conf.py
Updating file /home/firma/devel/test/ndx-my-namespace/docs/source/conf_doc_autogen.py
Creating file /home/firma/devel/test/ndx-my-namespace/docs/Makefile
Creating file /home/firma/devel/test/ndx-my-namespace/docs/source/description.rst
Creating file /home/firma/devel/test/ndx-my-namespace/docs/source/release_notes.rst
Creating file /home/firma/devel/test/ndx-my-namespace/docs/source/credits.rst
Creating file /home/firma/devel/test/ndx-my-namespace/docs/source/format.rst
Creating file /home/firma/devel/test/ndx-my-namespace/docs/source/index.rst
Creating file /home/firma/devel/test/ndx-my-namespace/docs/README.md
Leeres Git-Repository in /home/firma/devel/test/ndx-my-namespace/.git/ initialisiert
docs/source/credits.rst:13: leftover conflict marker
docs/source/credits.rst:21: leftover conflict marker
Traceback (most recent call last):
  File "/tmp/tmp8y5sens4.py", line 53, in <module>
    main()
  File "/tmp/tmp8y5sens4.py", line 42, in main
    _initialize_git()
  File "/tmp/tmp8y5sens4.py", line 32, in _initialize_git
    check_call(["git", "commit", "-m", "Initial commit"])
  File "/home/firma/.pyenv/versions/3.8.2/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'commit', '-m', 'Initial commit']' returned non-zero exit status 1.
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

I worked around that by defining

*.* conflict-marker-size=100

in ~/.config/git/attributes.

rly commented 4 years ago

@t-b I understand the source of the error but I cannot seem to reproduce this on my machine. I was using git 2.24 for windows and updated to 2.26.2.windows.1. In any case, I think adding a similar line to a .gitattributes file would resolve the issue. I did that here: https://github.com/nwb-extensions/ndx-template/commit/fa1ad235d484b404016197378e0e79075a928127 (which should have been a PR...)

Could you please undo your git config workaround and try again to see if the issue is resolved? Thanks.

t-b commented 4 years ago

@rly Thanks. Works now!