I won't even pretend to know whats going on but...
running drush dog-init myproject results in the following.
A clean [no .git directory] copy of of Drupal 7 is put in the current directory.
The directory 'myproject' is created, and it has a copy of Drupal with a full git repo.
But, it is already in an 'unclean' state.
git st reports that files are untracked and modified.

Untracked files
modules/shortcut/shortcut-rtl.css
#	modules/system/system.messages-rtl.css
#	modules/toolbar/toolbar-rtl.css
#	themes/seven/images/fc-rtl.png
#	themes/seven/vertical-tabs-rtl.css

Every file is marked modified because

// $Id$

has been removed.
There appears to be other modifications too.

Running Drush 4 latest, Mac OSX 10.5

Thanks

PS As the person who kicked off this page
http://drupal.org/node/803746
when I knew hardly anything about git
I am delighted to see this project!
Great work!

Comments

alanburke’s picture

Well in the previous attempt, I had left out the --upstream option.
So I tried drush dog-init --upstream=drupal-7.x myproject
This worked much better - I have a clean copy of Drupal with the latest commit on the 7.x branch,
but it did spew out a bunch of errors when done/

Downloading release history from                                                     [notice]
http://updates.drupal.org/release-history/drupal/7.x
Cloning 'git://git.drupal.org/project/drupal.git' into                                 [info]
/Users/alanburke/projects/sandbox/dog-test/drupal-dog2.
Successfully initialized a new dog instance in                                    [success]
/Users/alanburke/projects/sandbox/dog-test/drupal-dog2.
PHP Fatal error:  Uncaught exception 'Exception' with message 'Invocation of 'git reset --hard '7.x'' failed with return code 128: 
fatal: ambiguous argument '7.x': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
' in /private/var/aegir/drush/commands/dog/dog.drush.inc:152
Stack trace:
#0 /private/var/aegir/drush/commands/dog/dog.drush.inc(255): _dog_git_invoke('git reset --har...', false, '/Users/alanburk...')
#1 [internal function]: drush_dog_init('drupal-dog2')
#2 /private/var/aegir/drush/includes/command.inc(120): call_user_func_array('drush_dog_init', Array)
#3 /private/var/aegir/drush/includes/command.inc(58): drush_invoke_args('dog-init', Array)
#4 [internal function]: drush_invoke('dog-init', 'drupal-dog2')
#5 /private/var/aegir/drush/includes/command.inc(721): call_user_func_array('drush_invoke', Array)
#6 [internal function]: drush_command('drupal-dog2')
#7 /private/var/aegir/drush/includes/command.inc(204): call_user_func_array('drush_command', Array)
#8 /private/var/aegir in /private/var/aegir/drush/commands/dog/dog.drush.inc on line 152

Fatal error: Uncaught exception 'Exception' with message 'Invocation of 'git reset --hard '7.x'' failed with return code 128: 
fatal: ambiguous argument '7.x': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
' in /private/var/aegir/drush/commands/dog/dog.drush.inc:152
Stack trace:
#0 /private/var/aegir/drush/commands/dog/dog.drush.inc(255): _dog_git_invoke('git reset --har...', false, '/Users/alanburk...')
#1 [internal function]: drush_dog_init('drupal-dog2')
#2 /private/var/aegir/drush/includes/command.inc(120): call_user_func_array('drush_dog_init', Array)
#3 /private/var/aegir/drush/includes/command.inc(58): drush_invoke_args('dog-init', Array)
#4 [internal function]: drush_invoke('dog-init', 'drupal-dog2')
#5 /private/var/aegir/drush/includes/command.inc(721): call_user_func_array('drush_invoke', Array)
#6 [internal function]: drush_command('drupal-dog2')
#7 /private/var/aegir/drush/includes/command.inc(204): call_user_func_array('drush_command', Array)
#8 /private/var/aegir in /private/var/aegir/drush/commands/dog/dog.drush.inc on line 152
Drush command terminated abnormally due to an unrecoverable error.                [error]
Error: Uncaught exception 'Exception' with message 'Invocation of 'git reset
--hard '7.x'' failed with return code 128: 
fatal: ambiguous argument '7.x': unknown revision or path not in the working
tree.
Use '--' to separate paths from revisions
' in /private/var/aegir/drush/commands/dog/dog.drush.inc:152
Stack trace:
#0 /private/var/aegir/drush/commands/dog/dog.drush.inc(255): _dog_git_invoke('git
reset --har...', false, '/Users/alanburk...')
#1 [internal function]: drush_dog_init('drupal-dog2')
#2 /private/var/aegir/drush/includes/command.inc(120):
call_user_func_array('drush_dog_init', Array)
#3 /private/var/aegir/drush/includes/command.inc(58):
drush_invoke_args('dog-init', Array)
#4 [internal function]: drush_invoke('dog-init', 'drupal-dog2')
#5 /private/var/aegir/drush/includes/command.inc(721):
call_user_func_array('drush_invoke', Array)
#6 [internal function]: drush_command('drupal-dog2')
#7 /private/var/aegir/drush/includes/command.inc(204):
call_user_func_array('drush_command', Array)
#8 /private/var/aegir in /private/var/aegir/drush/commands/dog/dog.drush.inc,
line 152

alanburke’s picture

More testing
drush dog-init --upstream=drupal-7.0 myproject
acts the same as the intial test in the opening comment where no --upstream was given.
Oddly, when I add a --collab option, I still get the 'unclean' repo problem,
but no copy of Drupal appears in the directory from whre I issue the command.

sdboyer’s picture

Yeah, I'm definitely still working out some kinks in the validation. Really, this is all super-early alpha code. Clearly, as I haven't even cleaned up the error validation yet, which is why it double-spews on errors thrown by git invocations.

Anyway, continued testing would be most appreciated - give it another shot, I've fixed a few things in the init since you filed this.

alanburke’s picture

Got the updates.
drush dog-init myproject works fine now.
No extra copy of Drupal, a clean checkout of Drupal 7.0 is in the directory.
Still some debugging messages - pasted here for your reading pleasure.

[dog-test]$ drush dog-init myproject
Downloading release history from                                                     [notice]
http://updates.drupal.org/release-history/drupal/7.x
Array to string conversion dog.drush.inc:142                                         [notice]
Cloning 'git://git.drupal.org/project/drupal.git' into                                 [info]
/Users/alanburke/projects/sandbox/dog-test/myproject.
Successfully initialized a new dog instance in                                    [success]
/Users/alanburke/projects/sandbox/dog-test/myproject.
PHP Fatal error:  Uncaught exception 'Exception' with message 'Invocation of 'git add -- sites/default/files/.gitignore' failed with return code 128: 
The following paths are ignored by one of your .gitignore files:
sites/default/files
Use -f if you really want to add them.
fatal: no files added
' in /private/var/aegir/drush/commands/dog/dog.drush.inc:152
Stack trace:
#0 /private/var/aegir/drush/commands/dog/dog.drush.inc(264): _dog_git_invoke('git add -- site...', '/Users/alanburk...')
#1 [internal function]: drush_dog_init('myproject')
#2 /private/var/aegir/drush/includes/command.inc(120): call_user_func_array('drush_dog_init', Array)
#3 /private/var/aegir/drush/includes/command.inc(58): drush_invoke_args('dog-init', Array)
#4 [internal function]: drush_invoke('dog-init', 'myproject')
#5 /private/var/aegir/drush/includes/command.inc(721): call_user_func_array('drush_invoke', Array)
#6 [internal function]: drush_command('myproject')
#7 /private/var/aegir/drush/includes/command.inc(204): call_user_func_array('drush_command', A in /private/var/aegir/drush/commands/dog/dog.drush.inc on line 152

Fatal error: Uncaught exception 'Exception' with message 'Invocation of 'git add -- sites/default/files/.gitignore' failed with return code 128: 
The following paths are ignored by one of your .gitignore files:
sites/default/files
Use -f if you really want to add them.
fatal: no files added
' in /private/var/aegir/drush/commands/dog/dog.drush.inc:152
Stack trace:
#0 /private/var/aegir/drush/commands/dog/dog.drush.inc(264): _dog_git_invoke('git add -- site...', '/Users/alanburk...')
#1 [internal function]: drush_dog_init('myproject')
#2 /private/var/aegir/drush/includes/command.inc(120): call_user_func_array('drush_dog_init', Array)
#3 /private/var/aegir/drush/includes/command.inc(58): drush_invoke_args('dog-init', Array)
#4 [internal function]: drush_invoke('dog-init', 'myproject')
#5 /private/var/aegir/drush/includes/command.inc(721): call_user_func_array('drush_invoke', Array)
#6 [internal function]: drush_command('myproject')
#7 /private/var/aegir/drush/includes/command.inc(204): call_user_func_array('drush_command', A in /private/var/aegir/drush/commands/dog/dog.drush.inc on line 152
Drush command terminated abnormally due to an unrecoverable error.                [error]
Error: Uncaught exception 'Exception' with message 'Invocation of 'git add --
sites/default/files/.gitignore' failed with return code 128: 
The following paths are ignored by one of your .gitignore files:
sites/default/files
Use -f if you really want to add them.
fatal: no files added
' in /private/var/aegir/drush/commands/dog/dog.drush.inc:152
Stack trace:
#0 /private/var/aegir/drush/commands/dog/dog.drush.inc(264): _dog_git_invoke('git
add -- site...', '/Users/alanburk...')
#1 [internal function]: drush_dog_init('myproject')
#2 /private/var/aegir/drush/includes/command.inc(120):
call_user_func_array('drush_dog_init', Array)
#3 /private/var/aegir/drush/includes/command.inc(58):
drush_invoke_args('dog-init', Array)
#4 [internal function]: drush_invoke('dog-init', 'myproject')
#5 /private/var/aegir/drush/includes/command.inc(721):
call_user_func_array('drush_invoke', Array)
#6 [internal function]: drush_command('myproject')
#7 /private/var/aegir/drush/includes/command.inc(204):
call_user_func_array('drush_command', A in
/private/var/aegir/drush/commands/dog/dog.drush.inc, line 152

alanburke’s picture

The command seems to work fine with the --collab option and --upstream option too now.
I've only tried it with d.o as the upstream yet.

sdboyer’s picture

I've gotten it working with a local upstream, so I think that one's good.

That's a good case you've raised there, though - in your global .gitignore, you ignore sites/default/files. I'm circumspect about hardcoding dog's setup to include adding the files dir in the way it currently is regardless, but as long as it's in there then it needs to accommodate the situation where a global ignore will cause an error like that.

alanburke’s picture

I had actually forgotten about my global .gitignore.
sites/default/settings.phpis ignored too.

sdboyer’s picture

Status: Active » Fixed

I'm thinking the original basic issue should *probably* be fixed now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.