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

Not possible to get specific commit #50

Closed
thomaspaulb opened this issue Jan 22, 2021 · 7 comments
Closed

Not possible to get specific commit #50

thomaspaulb opened this issue Jan 22, 2021 · 7 comments

Comments

@thomaspaulb
Copy link
Contributor

I'm using latest gitaggregator 1.8.1.

I'm running gitaggregate --expand-env --config repos.yaml --jobs 4 aggregate

I have this in my config file:

ICTSTUDIO/odoo-extra-addons:
  defaults:
    depth: 100
  remotes:
    origin: https://github.com/ICTSTUDIO/odoo-extra-addons.git
  target: origin 10.0
  merges:
    - origin 6105fb108c2fa27fee68bab7a5fb9af95e4166e
  fetch_all: true

I'm getting:

Traceback (most recent call last):
File "/data/buildout/freshfilter/.venv/lib/python2.7/site-packages/git_aggregator/main.py", line 219, in aggregate_repo
repo.aggregate()
File "/data/buildout/freshfilter/.venv/lib/python2.7/site-packages/git_aggregator/repo.py", line 191, in aggregate
self._merge(merge)
File "/data/buildout/freshfilter/.venv/lib/python2.7/site-packages/git_aggregator/repo.py", line 270, in _merge
self.log_call(cmd, cwd=self.cwd)
File "/data/buildout/freshfilter/.venv/lib/python2.7/site-packages/git_aggregator/repo.py", line 160, in log_call
ret = callwith(cmd, **kw)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '(u'git', u'pull', u'--no-edit', u'--quiet', u'--depth', '100', 'origin', '6105fb108c2fa27fee68bab7a5fb9af95e4166e')' returned non-zero exit status 1

@sbidoul
Copy link
Member

sbidoul commented Aug 12, 2021

If you want to apply a single commit, you can use something like this

shell_command_after:
  - curl -sSL https://github.com/ICTSTUDIO/odoo-extra-addons/commit/6105fb108c2fa27fee68bab7a5fb9af95e4166e.patch | git am

@thomaspaulb
Copy link
Contributor Author

I think what I meant to do here was not to cherry-pick a single commit, but to checkout the branch at a certain commit (branch pinning). However I think it is implemented by this patch I just have to change

  merges:
    - origin 6105fb108c2fa27fee68bab7a5fb9af95e4166e

to

  merges:
    - origin 10.0 6105fb108c2fa27fee68bab7a5fb9af95e4166e

So this can be closed.

@janverb
Copy link
Contributor

janverb commented Aug 20, 2021

I don't think that patch enables that as-is, I wrote c5bbedf on top of it to support that.

@thomaspaulb
Copy link
Contributor Author

@janverb Is that in a PR at the moment?

@janverb
Copy link
Contributor

janverb commented Aug 20, 2021

Not yet. I'd have to add some documentation to make it PR-ready, and it would be nice to have #29 merged first.

@sbidoul
Copy link
Member

sbidoul commented Sep 21, 2022

Can you check if this works better with the last release, which changed the strategy to clone+fetch.

@thomaspaulb
Copy link
Contributor Author

Can you check if this works better with the last release, which changed the strategy to clone+fetch.

I've checked, and yes, this particular example now works better with the clone+fetch strategy.

I've also checked a more complicated example with several sources:

OCA/web:
  defaults:
    depth: 10
  remotes:
    origin: https://github.com/OCA/web.git
    forgeflow: https://github.com/forgeflow/web.git
  target: origin 10.0
  merges:
    - origin d20edd1b171c166b6f7d016ac2cfb044a95f084f
    - forgeflow 27be86ab189d91aeb9b4be7bb11198dc016f43fa

Which works, so this can be closed.

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

No branches or pull requests

3 participants