1

I would like to use the assume command in order to chain it 5 times.

[alias]
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumeall = "!git ls-files ../.idea/misc.xml | xargs git assume"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"

but when running i get this error:

fatal: '../.idea/misc.xml' is outside repository

The assume, unassume, unassumeall work just fine.

JY2k
  • 2,879
  • 1
  • 31
  • 60

2 Answers2

1

Simply check if '../.idea/misc.xml' reference a file which is a git repo.

For instance, if you go to the .idea/ folder, and look for the root folder of the git repo, does it return a folder?

git rev-parse --show-toplevel

If not, .idea/ is outside a git repo, and git ls-files cannot be applied.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

try

[alias] assumeall = "!git ls-files $(git rev-parse --show-toplevel)/.idea/misc.xml | xargs git assume"

gmaliar
  • 5,294
  • 1
  • 28
  • 36
  • how do i do i supply a number of files. – JY2k Nov 13 '14 at 11:11
  • You don't need to explicitly search for the toplevel. Git aliases with a leading `!` will be treated as shell commands and be executed in the toplevel folder of the repository. This means that you could simply do `!git ls-files .idea.misc.xml ...`. [Take a look at the config docu](http://git-scm.com/docs/git-config). – Sascha Wolf Nov 13 '14 at 11:31
  • I obviously meant to write `!git ls-files .idea/misc.xml ...` – Sascha Wolf Nov 13 '14 at 12:12