Zim

Version Control fails to autosave on startup

Bug #1302730 reported by sojusnik
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zim
Fix Released
Undecided
Unassigned

Bug Description

Version Control fails to autosave with GIT.

Happens with the recently released ZIM version from Jaap's Snapshots PPA.

zim -D says:

XYZ@XYZ:~$ zim -D
INFO: This is zim 0.60
DEBUG: Python version is sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)
DEBUG: Platform is posix
DEBUG: No bzr version-info found
DEBUG: Not running from a source dir
DEBUG: Set XDG_DATA_HOME to /home/sojusnik/.local/share
DEBUG: Set XDG_DATA_DIRS to [<Dir: /usr/share/default>, <Dir: /usr/share/gnome>, <Dir: /usr/local/share>, <Dir: /usr/share>]
DEBUG: Set XDG_CONFIG_HOME to /home/sojusnik/.config
DEBUG: Set XDG_CONFIG_DIRS to [<Dir: /etc/xdg/xdg-default>, <Dir: /etc/xdg>]
DEBUG: Set XDG_CACHE_HOME to /home/sojusnik/.cache
DEBUG: Loading config from: <zim.notebook.VirtualFile object at 0x7fb692729290>
DEBUG: Loading config from: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/notebook.zim
DEBUG: Wrote /home/sojusnik/.config/zim/notebooks.list
INFO: Using default notebook: file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines
DEBUG: Wrote /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/tmp
INFO: Remove file: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/tmp
DEBUG: Loading config from: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/notebook.zim
DEBUG: Cache dir: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim
DEBUG: Index database file: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/index.db
DEBUG: Remote call from 26206: <RemoteMethodCall: 26206: zim.ipc.Server(None).ping((), {})>
DEBUG: Starting server by spawning new process
INFO: Spawning: ['/usr/bin/zim', '--ipc-server-main', '/tmp/zim-sojusnik/zim-server-socket', '10'] (cwd: None)
DEBUG: Process started with PID: 26359
DEBUG: Remote call from 26206: <RemoteMethodCall: 26206: zim.ipc.Server(None).ping((), {})>
INFO: Server starting 26359 at /tmp/zim-sojusnik/zim-server-socket
DEBUG: Remote call returned to 26206: ('ACK', 26359)
DEBUG: Remote call from 26206: <RemoteMethodCall: 26206: zim.ipc.Server(None).has_object((<RemoteObject: zim.gui.GtkInterface(file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines)>,), {})>
DEBUG: Remote call returned to 26206: False
DEBUG: Remote call from 26206: <RemoteMethodCall: 26206: zim.ipc.Server(None).init_object((<RemoteObject: zim.gui.GtkInterface(file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines)>,), {})>
DEBUG: Wrote <UnixFile: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/tmp>
INFO: Remove file: <UnixFile: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/tmp>
DEBUG: Loading config from: <UnixFile: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/notebook.zim>
DEBUG: Cache dir: <Dir: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim>
DEBUG: Index database file: <UnixFile: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/index.db>
DEBUG: Opening notebook: <zim.notebook.Notebook object at 0x7f0ea7160c90>
DEBUG: Loading config from: <ConfigFile: /home/sojusnik/.config/zim/preferences.conf>
DEBUG: Loading plugin: attachmentbrowser
DEBUG: Loading plugin: distractionfree
DEBUG: Loading plugin: insertsymbol
DEBUG: Loading plugin: linesorter
DEBUG: Loading plugin: linkmap
DEBUG: Loading plugin: printtobrowser
DEBUG: Loading plugin: spell
DEBUG: Loading plugin: tableofcontents
DEBUG: Loading plugin: tags
DEBUG: Loading plugin: versioncontrol
INFO: VCS detected: git - <Dir: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines>
DEBUG: Gtk version is (2, 24, 22)
DEBUG: Pygtk version is (2, 24, 0)
WARNING: Could not find all icon sizes for the application icon
DEBUG: Loading config from: <ConfigFile: /home/sojusnik/.config/zim/style.conf>
DEBUG: Loading config from: <UnixFile: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/state.conf>
DEBUG: Child process started 26361 for <RemoteObject: zim.gui.GtkInterface(file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines)>
INFO: Starting async index update
DEBUG: Remote call returned to 26206: True
DEBUG: Remote call from 26206: <RemoteMethodCall: 26206: zim.gui.GtkInterface(file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines).present((), {'geometry': None, 'fullscreen': None, 'page': None})>
DEBUG: Accelmap: /home/sojusnik/.config/zim/accelmap
INFO: Accelerator changed for <Actions>/MainWindowExtension/print_to_browser
INFO: Accelerator changed for <Actions>/MainWindowExtension/toggle_spellcheck
INFO: Accelerator changed for <Actions>/MainWindowExtension/save_version
INFO: Running: ['git', 'status'] (cwd: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines)
DEBUG: Action: toggle_toolbar
DEBUG: Action: set_pathbar_recent
INFO: Running: ['git', 'add', '.'] (cwd: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines)
INFO: Running: ['git', 'status'] (cwd: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines)
INFO: Open page: <FileStorePage: Computer:Bugs und Verbesserungen:TinyTinyRSS> (<HistoryPath: Computer:Bugs und Verbesserungen:TinyTinyRSS>)
INFO: Running: ['git', 'commit', '-a', '-m', 'Automatisch gespeicherte Version'] (cwd: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines)
DEBUG: Remote call returned to 26206: None
DEBUG: NOTE FOR BUG REPORTS:
 At this point zim has send the command to open a notebook to a
 background process and the current process will now quit.
 If this is the end of your debug output it is probably not useful
 for bug reports. Please close all zim windows, quit the
 zim trayicon (if any), and try again.

sojusnik@mir:~$ INFO: Accelerator changed for <Actions>/MainWindowExtension/show_versions
INFO: Accelerator changed for <Actions>/MainWindowExtension/sort_selected_lines
INFO: Accelerator changed for <Actions>/MainWindowExtension/toggle_fileview
INFO: Accelerator changed for <Actions>/MainWindowExtension/show_linkmap
INFO: Accelerator changed for <Actions>/MainWindowExtension/insert_symbol
ERROR: Error during async commit
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/zim/utils.py", line 282, in run
    self.result = self.func(*self.args, **self.kwargs)
  File "/usr/lib/pymodules/python2.7/zim/plugins/versioncontrol/__init__.py", line 198, in do_save_version
    self.notebook_ext.vcs.commit(msg)
  File "/usr/lib/pymodules/python2.7/zim/plugins/versioncontrol/__init__.py", line 503, in commit
    self._commit(msg)
  File "/usr/lib/pymodules/python2.7/zim/plugins/versioncontrol/__init__.py", line 511, in _commit
    self.vcs.commit(None, msg)
  File "/usr/lib/pymodules/python2.7/zim/plugins/versioncontrol/git.py", line 107, in commit
    return self.run(params)
  File "/usr/lib/pymodules/python2.7/zim/plugins/versioncontrol/__init__.py", line 581, in run
    self._app.run(params, self.root)
  File "/usr/lib/pymodules/python2.7/zim/applications.py", line 190, in run
    raise ApplicationError(argv[0], argv[1:], p.returncode, p.stderr.read())
ApplicationError: Anwendung konnte nicht gestartet werden: git

Aufruf von git "commit" "-a" "-m" "Automatisch gespeicherte Version" fehlgeschlagen. Fehlercode: 1

DEBUG: Running ErrorDialog
DEBUG: Anwendung konnte nicht gestartet werden: git
None
ERROR: Anwendung konnte nicht gestartet werden: git

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 1302730] [NEW] Version Control fails to autosave
Download full text (7.9 KiB)

Can you check if you can run the git command autside of zim?

Regards,

Jaap

On Fri, Apr 4, 2014 at 7:34 PM, sojusnik <email address hidden> wrote:

> Public bug reported:
>
> Version Control fails to autosave with GIT.
>
> Happens with the recently released ZIM version from Jaap's Snapshots
> PPA.
>
> zim -D says:
>
> XYZ@XYZ:~$ zim -D
> INFO: This is zim 0.60
> DEBUG: Python version is sys.version_info(major=2, minor=7, micro=5,
> releaselevel='final', serial=0)
> DEBUG: Platform is posix
> DEBUG: No bzr version-info found
> DEBUG: Not running from a source dir
> DEBUG: Set XDG_DATA_HOME to /home/sojusnik/.local/share
> DEBUG: Set XDG_DATA_DIRS to [<Dir: /usr/share/default>, <Dir:
> /usr/share/gnome>, <Dir: /usr/local/share>, <Dir: /usr/share>]
> DEBUG: Set XDG_CONFIG_HOME to /home/sojusnik/.config
> DEBUG: Set XDG_CONFIG_DIRS to [<Dir: /etc/xdg/xdg-default>, <Dir:
> /etc/xdg>]
> DEBUG: Set XDG_CACHE_HOME to /home/sojusnik/.cache
> DEBUG: Loading config from: <zim.notebook.VirtualFile object at
> 0x7fb692729290>
> DEBUG: Loading config from: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/notebook.zim
> DEBUG: Wrote /home/sojusnik/.config/zim/notebooks.list
> INFO: Using default notebook:
> file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines
> DEBUG: Wrote /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim/tmp
> INFO: Remove file: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/.zim/tmp
> DEBUG: Loading config from: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/notebook.zim
> DEBUG: Cache dir: /home/sojusnik/Sonstiges/Zim Notebooks/Allgemeines/.zim
> DEBUG: Index database file: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/.zim/index.db
> DEBUG: Remote call from 26206: <RemoteMethodCall: 26206:
> zim.ipc.Server(None).ping((), {})>
> DEBUG: Starting server by spawning new process
> INFO: Spawning: ['/usr/bin/zim', '--ipc-server-main',
> '/tmp/zim-sojusnik/zim-server-socket', '10'] (cwd: None)
> DEBUG: Process started with PID: 26359
> DEBUG: Remote call from 26206: <RemoteMethodCall: 26206:
> zim.ipc.Server(None).ping((), {})>
> INFO: Server starting 26359 at /tmp/zim-sojusnik/zim-server-socket
> DEBUG: Remote call returned to 26206: ('ACK', 26359)
> DEBUG: Remote call from 26206: <RemoteMethodCall: 26206:
> zim.ipc.Server(None).has_object((<RemoteObject:
> zim.gui.GtkInterface(file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines)>,),
> {})>
> DEBUG: Remote call returned to 26206: False
> DEBUG: Remote call from 26206: <RemoteMethodCall: 26206:
> zim.ipc.Server(None).init_object((<RemoteObject:
> zim.gui.GtkInterface(file:///home/sojusnik/Sonstiges/Zim%20Notebooks/Allgemeines)>,),
> {})>
> DEBUG: Wrote <UnixFile: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/.zim/tmp>
> INFO: Remove file: <UnixFile: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/.zim/tmp>
> DEBUG: Loading config from: <UnixFile: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/notebook.zim>
> DEBUG: Cache dir: <Dir: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/.zim>
> DEBUG: Index database file: <UnixFile: /home/sojusnik/Sonstiges/Zim
> Notebooks/Allgemeines/.zim/index.db>
> DEBUG: Opening notebook...

Read more...

Revision history for this message
sojusnik (sojusnik) wrote : Re: Version Control fails to autosave

I'm not really Git savy, can you provide the proper command to test it?

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 1302730] Re: Version Control fails to autosave

Afraid I'm not much of a Git user myself etiher, but basic commands like
"git status" and "git commit" should work.

REgards,

Jaap

On Sat, Apr 12, 2014 at 8:23 PM, sojusnik <email address hidden>wrote:

> I'm not really Git savy, can you provide the proper command to test it?
>
> --
> You received this bug notification because you are subscribed to Zim.
> https://bugs.launchpad.net/bugs/1302730
>
> Title:
> Version Control fails to autosave
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zim/+bug/1302730/+subscriptions
>

Revision history for this message
sojusnik (sojusnik) wrote : Re: Version Control fails to autosave

This bug is being discussed here in detail: https://answers.launchpad.net/zim/+question/252551

Revision history for this message
sojusnik (sojusnik) wrote :

@Jaap

So, yes, git runs perfectly outside of Zim. It seems, that the german local is causing this.

summary: - Version Control fails to autosave
+ Version Control fails to autosave on startup
Revision history for this message
Rolf Kleef (rolf-drostan) wrote :

The version control plugin for git checks for changes by comparing the output of 'git status' with a hard-coded English string. In /usr/share/pyshared/zim/plugins/versioncontrol/git.py:

 def is_modified(self):
  """Returns true if the repo is not up-to-date, or False
  @returns: True if the repo is not up-to-date, or False
  """
  # If status return an empty answer, this means the local repo is up-to-date
  return not (''.join( self.status() ).find( 'nothing to commit' ) > -1)

So in German it'll always report the repository is not up to date, and try to do a commit. 'git commit -m "Autoversion"' will return error code 1 ("nothing to commit, working directory clean")

'git status --porcelain' returns a locale-independent status intended for machine processing (empty if nothing has changed), but maybe not ideal for display to the user in SaveVersionDialog(Dialog)...

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Thanks for pointing me to the --porcelain switch !

Will commit patch in rev703.

Changed in zim:
status: New → Fix Committed
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Fixed <= release 0.62

Changed in zim:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.