git-debrebase: new-upstream: Do not treat late options as version Instead of a new upstream version, the user may wish to pass -i. (Or other git-rebase options.) This is handled correctly when we are deciding whether to treat further arguments as additional piece specifications, but the new optional upstream version commitish was mishandled in this respect. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: Fix error message for wrong use of -i Getopt::Long with "i:s" parses "-i something" as "-i" with a value of "something". Maybe I didn't know this when I wrote this code, and thought the check for $val would only reject "-isomething". But "git-rebrebase ... -i something" is wrong because it would mean "git-rebase -i something" and we do not permit the user to specify their own base. So it is right to bail out in this case. However, the message was wrong, since it refers to cuddling, and it can be caused by a non-cuddled non-option argument. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Fix upstream_commitish_search API upstream_commitish_search used to return a commit. If it succeeded The caller could find the tag in $tried[-1]. Both callers relied on this unpleasant and error-prone API. In 0bb8e2a87e3c8b5be0fce5c2491b292e9273056e Dgit::upstream_commitish_search: fail if more than one tag exists the algorithm was changed to keep looking, so it can reject ambiguous situations. The result is that $tried[-1] is entirely wrong in the success case. (This is spotted by the tagupl-baredebian test.) It would have been possible to fix this by making upstream_commitish_search synthesise a suitable return value for putting in $tried, but that is absurd. Instead give this function a sensible calling convention. It now returns a list of the tag name (for messages etc.) and the commitish (for use). Change both call sites. CC: Sean Whitton <spwhitton@spwhitton.name> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: Rename a variable $ups_tag to $ups_rev This is a commit, not a tag. This is prepping for a change where the tag will be here in a variable too. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Dgit.pm: Provide @git This clears the way for some parts of Dgit.pm to honour dgit's git invocation conventions. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Update copyright notices in many files Mostly, adding 2019. Also adding some missing credits to Sean Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: fix convert-from-dgit-view argv handling [ S-o-b added after checking with ntyni on irc -iwj ] Signed-off-by: Niko Tyni <ntyni@debian.org> Closes: #930214 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: Replace one open-coded hash-object with hash_commit No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Dgit.pm: Move make_commit (git-commit-tree wrapper) from gdr No functional change other than to no longer honour @git. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Dgit.pm: Move read-tree wrappers from git-debrebase No functional change other than to no longer honour @git. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Dgit.pm: Move resolve_upstream_version from git-debrebase No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Dgit.pm: Move upstream_commitish_search from git-debrebase No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Replace `confess $!' with `confess "$!"', to actually print errno $ perl -e 'use Carp; open X, ">/dev/eacces" or die $!' Permission denied at -e line 1. $ perl -e 'use Carp; open X, ">/dev/eacces" or confess $!' at -e line 1. $ perl -e 'use Carp; open X, ">/dev/eacces" or confess "$!"' Permission denied at -e line 1. $ confess will get references to its arguments in @_. Its documentation says it saves/restores $!. I conjecture that these interact as we see here: $ perl -e '$!=1; sub x { print ">@_<\n"; } x $!;' >Operation not permitted< $ perl -e '$!=1; sub x { local $!; print ">@_<\n"; } x $!;' >< Quoting "$!" averts the reference (and it will also ensure that we get the string value of $!, in case confess were to do anything in the future which would mess that up). This commit was made like this: perl -i -pe 's/confess \$!/confess "\$!"/g' dgit perl -i -pe 's/confess \$!/confess "\$!"/g' git-debrebase perl -i -pe 's/confess \$!/confess "\$!"/g' Debian/Dgit.pm I have manually reviewed each hunk and it all looks good to me. Closes: #929549 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: convert-*: Fix two broken error messages If you failed to specify the upstream version, some of the messages would still attempt to report what you specified, causing a crash. Closes: #922462 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: resolve_upstream_version: Return $used too Update both callers but right now they just throw the information away. So no overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: Provide convert-from-unapplied aa alias for -gbp Closes: #905433. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase: usage message: Mention only convert-from-* There is convert-from-dgit-view which was not mentioned, and we're going to make another one in a moment. We don't want to list the whole lot here. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Dgit.pm: Move changedir_git_toplevel from git-debrebase NFC other than hardcoded qw(git). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
i18n: git-debrebase: mark final batch of messages (5) Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
i18n: git-debrebase: mark some messages (4) Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>