example.gitignore contains a reference to Drupal 7's .gitignore file that is no longer accurate, as Drupal 7 still contains a .gitignore file.

Comments

xano’s picture

Status: Active » Needs review
StatusFileSize
new677 bytes
jhodgdon’s picture

Status: Needs review » Closed (works as designed)

Um. Actually I think this is still the case that Drupal Core does not include a .gitignore file. It has been true since 7.9 apparently, and is still the case in 8.

xano’s picture

Status: Closed (works as designed) » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

Well, this patch is not the right answer then. 8.x does not have a .gitignore, and these two sentences explain why.

xano’s picture

The sentences before the ones the patch removes explain why Drupal 8 ships with example.gitignore and how to use it. Do we really want to tell people why Drupal 7 did include a .gitignore file and Drupal 8 does not?

jhodgdon’s picture

The first two paragraphs currently say:

# To use this file simply copy it to .gitignore, and it will cause files like
# your settings.php and user-uploaded files to be excluded from git source
# control.  This is a common strategy to avoid accidentally including private
# information in public repositories and patch files.
#
# A .gitignore file was included in Drupal core for versions 7.2 through 7.8.
# As of Drupal 7.9, this is no longer the case, and any changes made to your
# .gitignore file will no longer be overwritten by core updates.

I think the last paragraph is useful in that it explains why Drupal doesn't have a .gitignore file directly in the code base, but I agree with this issue that we should take out the references to "drupal 7" and "no longer the case". It should just say something like "The reason that this file itself isn't named .gitignore is ..." and it could go in the previous paragraph.

ashish_nirmohi’s picture

-# A .gitignore file was included in Drupal core for versions 7.2 through 7.8.
-# As of Drupal 7.9, this is no longer the case, and any changes made to your
-# .gitignore file will no longer be overwritten by core updates.

# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php

I think in "drupal 8" gitingnore functionality is no longer desired to written again . It is set (.gitignore) already and no need to apply efforts on this.
Visit link for more reference to https://github.com/github/gitignore/blob/master/Drupal.gitignore .gitignore file info.

xano’s picture

What do you mean with "It is set"?

ashish_nirmohi’s picture

You can not make changes to the core file for git ignore file. It is already defined and well placed. I hope i am clear in this (xano) .

jhodgdon’s picture

Hm... So this is interesting. We have an example.gitignore file at the top level of the Drupal distro. But we also have a .gitignore file under the core directory. Maybe that is what #9 and #7 are talking about?

xano’s picture

/core/.gitifnore looks like it makes sure we don't commit any vendor files to our repository that we don't need. I'm not sure that is a good idea, but it is a different file and no D7 equivalent exists, as we didn't have vendor files in D7.

Also, I have no idea what @ashish_nirmohi means with #7 and #9.

xano’s picture

@jhodgdon: what do you suggest we do?

jhodgdon’s picture

Hm. This is what's in the example.gitignore at the moment in the header:

# To use this file simply copy it to .gitignore, and it will cause files like
# your settings.php and user-uploaded files to be excluded from git source
# control.  This is a common strategy to avoid accidentally including private
# information in public repositories and patch files.
#
# A .gitignore file was included in Drupal core for versions 7.2 through 7.8.
# As of Drupal 7.9, this is no longer the case, and any changes made to your
# .gitignore file will no longer be overwritten by core updates.

(Farther down the the file, I think the comments are all good, and I think we should leave them as they are.)

So...

That first paragraph looks very reasonable. I think we should leave it as it is.

The second paragraph... I think we should revise it to not mention particular versions of Drupal, but instead explain that the reason you are getting an example.gitignore file rather than a .gitignore file is so that when you upgrade Drupal core, it doesn't contain .gitignore and so it won't overwrite any customizations you've put into your own .gitignore.

And I think we might also mention that there is another .gitignore file in the core directory, which is used by Drupal Core developers for integration of third-party libraries, and that (like all other files in core) you should not edit that file.

Does that make sense?

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new1.21 KB

I clarified that example.gitignore contains defaults, and why the file is named the way it is. Is it better this way?

And I think we might also mention that there is another .gitignore file in the core directory, which is used by Drupal Core developers for integration of third-party libraries, and that (like all other files in core) you should not edit that file.

There are many .gitignore files in core, and I do not think we should be documenting those in the top-level example file. Also, ./core/.gitignore seems to contain enough documentation to explain why the file is needed (our crazy decision to include other git repos in our own).

jhodgdon’s picture

Status: Needs review » Needs work

Looks pretty good!

Can we get rid of the word "simply" in there? Doesn't add anything. And I think... could we say "... make a copy of this file, and name it .gitignore..."?

I'm also not sure if these lines get across the point:

+# Because .gitignore can be specific to your site, this file has a different
+# name; updates to it will not override your custom .gitignore file.

I think it needs to have the phrase "when you update Drupal core" in there somewhere, to explain where the "updates to it" come from?

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new1.21 KB

Good points! Does this look better?

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

I love it! Thanks!

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 8.x.

  • Commit 1167235 on 8.x by jhodgdon:
    Issue #2244749 by Xano: Fix documentation in example.gitignore file
    

Status: Fixed » Closed (fixed)

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