Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

add only modified files #519

Merged
merged 2 commits into from
Oct 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/git-plus-commands.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ getCommands = ->
git.refresh()
commands = []
commands.push ['git-plus:add', 'Add', -> GitAdd(repo)]
commands.push ['git-plus:add-modified', 'Add Modified', -> git.addModified(repo).then -> GitCommit(repo)]
commands.push ['git-plus:add-all', 'Add All', -> GitAdd(repo, addAll: true)]
commands.push ['git-plus:log', 'Log', -> GitLog(repo)]
commands.push ['git-plus:log-current-file', 'Log Current File', -> GitLog(repo, onlyCurrentFile: true)]
Expand Down
1 change: 1 addition & 0 deletions lib/git-plus.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ module.exports =
@subscriptions.add atom.commands.add 'atom-workspace', 'git-plus:init', -> GitInit()
@subscriptions.add atom.commands.add 'atom-workspace', 'git-plus:menu', -> new GitPaletteView()
@subscriptions.add atom.commands.add 'atom-workspace', 'git-plus:add', -> git.getRepo().then((repo) -> GitAdd(repo))
@subscriptions.add atom.commands.add 'atom-workspace', 'git-plus:add-modified', -> git.getRepo().then((repo) -> git.addModified(repo).then -> GitCommit(repo))
@subscriptions.add atom.commands.add 'atom-workspace', 'git-plus:add-all', -> git.getRepo().then((repo) -> GitAdd(repo, addAll: true))
@subscriptions.add atom.commands.add 'atom-workspace', 'git-plus:commit', -> git.getRepo().then((repo) -> GitCommit(repo))
@subscriptions.add atom.commands.add 'atom-workspace', 'git-plus:commit-all', -> git.getRepo().then((repo) -> GitCommit(repo, stageChanges: true))
Expand Down
8 changes: 8 additions & 0 deletions lib/git.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ module.exports = git =
notifier.addSuccess "Added #{file ? 'all files'}"
.catch (msg) -> notifier.addError msg

addModified: (repo) ->
args = ['add', '-u']
git.cmd(args, cwd: repo.getWorkingDirectory())
.then (output) ->
if output isnt false
notifier.addSuccess "Added #{file ? 'all files'}"
.catch (msg) -> notifier.addError msg

getRepo: ->
new Promise (resolve, reject) ->
getRepoForCurrentFile().then (repo) -> resolve(repo)
Expand Down
4 changes: 4 additions & 0 deletions menus/git-plus.cson
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
'label': 'Add'
'command': 'git-plus:add'
}
{
'label': 'Add Modified'
'command': 'git-plus:add-modified'
}
{
'label': 'Add All'
'command': 'git-plus:add-all'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"atom-workspace": [
"git-plus:menu",
"git-plus:add",
"git-plus:add-modified",
"git-plus:add-all",
"git-plus:add-all-and-commit",
"git-plus:add-all-commit-and-push",
Expand Down