Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
compare .plist changes between 2 git branches

Comparing p-lists (iOS Property List Files)

In OS X and iOS programming frameworks, property list files are used to store information about bundles and applications. Analyzing .plist files can tell you a lot about an application. It is often useful to compare content and view modifications to .plist files to understand what has changed between versions of an application.


  • list paths of .plist files modified between 2 branches
$ git diff --name-only "origin/branch1" "origin/branch2" -- 
  • show diffs from .plist modifications between 2 branches
  $ git diff --name-only "origin/branch1" "origin/branch2 |
  grep '.plist$' |
  xargs git diff "origin/$branch1" "origin/branch2" --

Example:
  1. create a script named pldiff.sh somewhere on your path:
    #!/usr/bin/env bash
    # Usage: pldiff branch1 branch2
    git diff --name-only "origin/$1" "origin/$2" |
    grep '.plist$' |
    xargs git diff "origin/$1" "origin/$2" --   
    
  2. make the script executable.
$ chmod +x pldiffs.sh
  1. clone git repo
    $ git clone --recursive https://source.corp.lookout.com/lookout/client-ios.git
    $ cd client_ios
    
  2. run pldiff.sh script with 2 branch names as args:
    $ pldiff.sh release-consumer-4.4.3 release-consumer-4.4.5
    

You should see a colored diff from every modification.


#!/usr/bin/env bash
# Usage: pldiff branch1 branch2
git diff --name-only "origin/$1" "origin/$2" |
grep '.plist$' |
xargs git diff "origin/$1" "origin/$2" --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.