module GitSpelunk

Given a sha and a line_number in this sha, this module calculates the corresponding line number in sha's parent.

  1. It uses git diff for the sha & its parent to get all the diff chunks.

  2. It then calculates which chunk given line_number belongs to.

  3. Once found the target chunk, it then goes to the sha's line_number in the diff

  4. It then calculate parent's line number by ignoring changes for sha in the diff

git diff 6d405155..379120f — a/app/assets/javascripts/lib/user_assume/chat_extension.module.js +++ b/app/assets/javascripts/lib/user_assume/chat_extension.module.js @@ -1,7 +1,6 @@ -/*globals ChatLotus*/

module.exports = Em.Object.extend({

+ ChatService: ChatLotus.Service, + hasChatEnabled: Em.computed.oneWay('ChatService.hasChatEnabled'),

previousAvailablity: false,

detach: function() {

@@ -19,10 +18,10 @@ module.exports = Em.Object.extend({

},

_isChatAvailable: function() {

+ return this.getPath('ChatService.Availability.available');

},

_toggleChatAvailability: function() {

+ this.getPath('ChatService.Availability').toggleAvailability();

  }
});

Constants

BlameLine
VERSION