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

Detect if "svn up"/"git pull"/etc resulted in any actual code updates #3

Open
reinout opened this issue Aug 21, 2015 · 3 comments
Open

Comments

@reinout
Copy link
Owner

reinout commented Aug 21, 2015

See original issue https://bitbucket.org/reinout/checkoutmanager/issues/22/add-command-switch-to-check-if by @chintal

I'm limiting the original issue to this:

What I'd like is reliably detecting whether "checkoutmanager up" resulted in any actual code updates. Seems hard to me, as hg/git/svn/bzr regularly change their output format and return codes and so. And it sometimes also is language-dependent. So... Any good ideas are welcome.

@reinout
Copy link
Owner Author

reinout commented Aug 21, 2015

Is depending on the output of git/hg/svn possible after all? We do run everything in verbose mode, so you could for instance detect changed filenames in the following git output:

Updating 16071cf..8948503
Fast-forward
 zest/releaser/tests/functional-svn.txt | 2 +-
 zest/releaser/tests/svn.txt            | 2 +-
 zest/releaser/tests/test_setup.py      | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
From github.com:zestsoftware/zest.releaser
   16071cf..8948503  master     -> origin/master

Another idea could be to use some "watch" tool on the filesystem. We should exclude the .git/, .svn/ directories then. Or perhaps watch modification dates.

Only... I don't want the checkoutmanager code to become twice as big :-)

@chintal
Copy link
Contributor

chintal commented Aug 21, 2015

To be clear, though, I never wanted the list of the files changed. The output of svn up or git pull already provides that, which is what checkoutmanager writes out to stdout by itself.

My problem was that the output was effectively too verbose. A list of the repositories that got/have changes is useful to me, since there are some repositories that I care about which aren't changed often. Also, with all that text scrolling down, I often did not realize that there was a problem during the update.

The changes I wrote against 1.16 (https://bitbucket.org/chintal/checkoutmanager/branches/compare/chintal/checkoutmanager:tip%0Dreinout/checkoutmanager:1.16#diff) were to allow me to look only at a final summary of everything that happened.

I'd recommend not actually using that code, though, because :

  1. I haven't kept up with the changes in your repository since then. The code as written then got the job done for me, and it's been stable enough (with caveats) since then.
  2. It doesn't support anything other than SVN, simply because it isn't implemented for anything else. I'm now in a position where having it support git and perhaps even git-svn (which is probably ambitious) would be nice.
  3. I'm presently considering using it as a python module from within a larger application instead of as a standalone script.

Due to these reasons, I'm seriously thinking about starting from a fresh checkout of checkoutmanager and redoing it. If you have any notes about it, or desirable behaviour or such, I can take that into account if/when I get around to working on it again.

I've only had one functional problem with the code over the last couple of years (the caveat). SVN conflicts are unreported, or not reported loudly enough. On occasion, this has led to stale repositories left in the tree.

As an example, right now (not connected to the network which has the repositories), I see :

chintal@longclaw:~$ checkoutmanager up
------------------------------------------------------------
Collected Reports on 80 Repositories
None of the repositories could be updated
------------------------------------------------------------
chintal@longclaw:~$ checkoutmanager cu
------------------------------------------------------------
Collected Reports on 80 Repositories
None of the repositories could be checked for updates
------------------------------------------------------------
chintal@longclaw:~$ 

When I am connected to the network, I get one line per repository that got an update / has an update that can be pulled :

chintal@longclaw:~$ checkoutmanager cu
------------------------------------------------------------
Collected Reports on 80 Repositories
Out of 80 successful checks, 2 repositories have new remote revisions
/home/chintal/quazar/svn/QDA/DAU/QDAL412B/software : 111 (Local) vs 142 (Remote)
/home/chintal/quazar/svn/Stock : 203 (Local) vs 206 (Remote)
------------------------------------------------------------
chintal@longclaw:~$ checkoutmanager up
------------------------------------------------------------
Collected Reports on 80 Repositories
Out of 80 successful updates, 2 repositories had new remote revisions which have been pulled
/home/chintal/quazar/svn/QDA/DAU/QDAL412B/software : 111 (Local) to 142 (Remote)
/home/chintal/quazar/svn/Stock : 203 (Local) to 206 (Remote)
------------------------------------------------------------
chintal@longclaw:~$

@reinout
Copy link
Owner Author

reinout commented Sep 9, 2015

See #14

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