[DONE] Display Git branch name and full description in View History

SITUATION

Here’s a typical Version History you might see while working purely inside Anvil (read from bottom to top of each screenshot):


And here’s how Git integration looks (see Level 6 of my Version Control for Dummies tutorial):


What I stumbled on but didn’t see documented anywhere is that from the local origin, you can use Git (or in my case Github Desktop) to create and push different branches (e.g. DEV1, DEV2, TEST1, TEST2) back to Anvil, which is brilliant and exactly what I wanted to do when @aldo.ercolani and I started asking questions on the forum last week:


Notice there’s even a helpful (but not very prominent) line linking DEV2 back to the Git Clone it was branched from…


And here’s how it looks when you merge DEV2 with ‘master’ locally using Git or Github Desktop etc and push back to the Anvil remote:


Notice again there’s a helpful (but not very prominent) line showing DEV2 has been merged into the Anvil remote (DEV). What’s not so clear perhaps is that the changes made in the Anvil IDE at 1:34pm have also incorporated in the 1:37pm version (I think).

TARGET

What seems to be missing and unclear to the point of being unusable in the above is that Anvil doesn’t currently import (or just doesn’t display?) the name of the local branch (‘master’ by default, then ‘DEV2’ etc) or the full Description. It just shows a greyed-out box with the Summary of the commit and no mention of the origin. If I hadn’t thought to explicitly mention DEV2 in my commit summary above (and why would I normally?), it wouldn’t be at all obvious where this new branch was coming from, and things would get even more confusing if I create multiple branches.

PROPOSAL

If you could simply add the name of the branch and full description to the View History, and perhaps add a prominent label to show it’s been pushed from an origin/Git Clone outside of Anvil, I think you could at a stroke avoid the shenanigans several (experienced) users like @stucork have suggested in terms of cloning DEV, TEST, and PROD versions of an Anvil app (either in Anvil itself and/or on the local machine) just to emulate existing functionallity of Github branches (see Levels 3, 4, 9, and 10 in my Version Control for Dummies tutorial and this whole thread).

I haven’t got my head around it fully, but suspect there’s still a need for creating an additional Github remote even with this change, so that other collaborators can create pull requests and branches (and forks?). A further Feature Request to avoid this might therefore be to integrate Github’s Settings, Manage Access, Invite a Collaborator function into the Anvil IDE, in order to share the original Anvil remote itself, directly and organically. I suspect this, or something similar, is actually what happens under the hood with Business Accounts when you add someone to your organisation… I’ve certainly seen @aldo.ercolani’s email appear in a shared Version History, but it wasn’t at all clear whether this was just “an Anvil thing” or actually coming from a Github branch/fork. I also suspect no new branch was created for my fellow collaborator, which would explain why only one of us could work on the Anvil app at a time, so unless anyone can spot a problem with it, it might be good to automatically create a new branch for each new collaborator as part of the Business Account’s Share With My Team function… Collaborators can then create additional branches as required using Github.

I’ve seen a screenshot somewhere on the Forum of a beta version improvement to the Version History with beautiful colours, nodes, and links, and don’t know how far off this is from being published… but hopefully this proposal is a relatively small change that could be made quickly (i.e. not wait for all the other bells and whistles) and immediately make a world of difference to people’s workflow with Git and the DEV/TEST/PROD concept.

2 Likes

I agree - it would be nice to be able to switch views from the default view to a view like this:

image

which is the beta screenshot you were referring to (from a 2016 blogpost https://anvil.works/blog/git-beta-announce)

perhaps this view could be hidden away in ‘advanced’ since it wouldn’t be required, and would be confusing, for many users.

3 Likes

This is now live, as part of the new (beta) Anvil Editor!

Check it out:

Find out more: Anvil Docs | Version Control and Collaboration

Read the launch post:

2 Likes

This is a really great enhancement thank you.