Shortcut subcommands

Bug #1706968 reported by Robie Basak on 2017-07-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I'd like:

git ubuntu changelog [treeish] -> equivalent to "git show treeish:debian/changelog", defaulting to HEAD.

git ubuntu version [treeish] -> equivalent to "git ubuntu changelog|dpkg-parsechangelog -SVersion"

Perhaps also:

git ubuntu version -a -> an output line of "<series> <version>" for every branch head matching "pkg/ubuntu/*-devel" or similar.

On my system I have:
  alias gu=git ubuntu

So then I could do "gu changelog" and "gu version" for a couple of extremely common actions while reviewing.

I don't know if we want this in the CLI though, or how well it might fit in.

Please discuss.

Nish Aravamudan (nacc) wrote :

What about just doing these as git aliases? I'm hesitant to add a ton of subcommands.

Would it make sense for this to to just be an alias we can install in the default .gitconfig when the snap installs? Maybe that wouldn't be ideal, though, as it won't show up in the help (but i think it will tab-complete).

Robie Basak (racb) wrote :

What would the command I'd be typing look like then?

Where does the default .gitconfig live for the snap install?

Nish Aravamudan (nacc) wrote :

    ubuntu-changelog = "!f() { git show $1:debian/changelog; }; f"
    ubuntu-version = "!f() { git ubuntu-changelog $1 | dpkg-parsechangelog -SVersion; }; f"

Aliases cannot currently have spaces in the alias name (bash limitation).

We are a classic snap, so the default .gitconfig is in $HOME. We could modify the `git ubuntu` command to look somewhere else, but we don't currently.

Example output:

nacc@pitfall:~/work/imports/php7.0 (ubuntu/devel)$ git ubuntu-changelog pkg/ubuntu/xenial-devel | head
php7.0 (7.0.18-0ubuntu0.16.04.1) xenial; urgency=medium

  * New upstream release 7.0.18
    - LP: #1686237
    - LP: #1674892
    - Refresh patches for new upstream release
  * Drop:
    - debian/patches/0053-Fix-pdo_pgsql.patch: Fixed #73959 - lastInsertId
      fails to throw an exception in pdsql. Thanks to andrewnester
      <email address hidden>. Closes LP #1658289.


nacc@pitfall:~/work/imports/php7.0 (ubuntu/devel)$ git ubuntu-version pkg/ubuntu/xenial-devel

Changed in usd-importer:
status: New → Triaged
Robie Basak (racb) on 2017-08-02
tags: added: onboarding-ux
Changed in usd-importer:
milestone: none → 1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers