Opened 4 years ago

Closed 4 years ago

#2972 closed defect (fixed)

ensure_dependencies.py doesn't add Git ignore paths relative to the project root

Reported by: sergz Assignee: kzar
Priority: P2 Milestone:
Module: Automation Keywords:
Cc: trev, sebastian Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29329302/

Description (last modified by kzar)

How to reproduce

git clone git@github.com:adblockplus/libadblockplus.git
cd libadblockplus
./ensure_dependencies.py
mkdir -p issue2972/adblockplus
touch issue2972/adblockplus/newfile
git status
git add issue2972/adblockplus/newfile

Observed behaviour

git status doesn't list the unstaged file issue2972/adblockplus/newfile and trying to git add it results in this warning:

The following paths are ignored by one of your .gitignore files:
issue2972/adblockplus/newfile
Use -f if you really want to add them.
fatal: no files added

(The problem is not present when using Mercurial instead of Git.)

Expected behaviour

The new file should be in the "Untracked files" section and adding it should work.

What is wrong

In .git/info/exclude there should be paths relative to the repository root, e.g /adblockplus instead of adblockplus

Change History (11)

comment:1 Changed 4 years ago by kzar

  • Cc kzar added

Your reproduction steps do not include any use of the ensure_dependencies.py script, please could you add any missing steps so I can attempt to reproduce this?

Thanks, Dave

comment:2 Changed 4 years ago by sergz

  • Description modified (diff)

comment:3 follow-up: Changed 4 years ago by kzar

I'm guessing you mean something like this:

git clone git@github.com:adblockplus/libadblockplus.git
cd libadblockplus/
./ensure_dependencies.py
touch include/AdblockPlus/newfile
git add include/AdblockPlus/newfile
git commit -m 'test'

But when I do that I can't reproduce the problem you're having. Could you clarify?

comment:4 Changed 4 years ago by sergz

  • Description modified (diff)

comment:5 in reply to: ↑ 3 Changed 4 years ago by sergz

Replying to kzar:

I'm guessing you mean something like this:

git clone git@github.com:adblockplus/libadblockplus.git
cd libadblockplus/
./ensure_dependencies.py
touch include/AdblockPlus/newfile
git add include/AdblockPlus/newfile
git commit -m 'test'

But when I do that I can't reproduce the problem you're having. Could you clarify?

I've tested it on case sensitive (I guess, your case) and case insensitive file systems and updated the issue description.

Thanks.

comment:6 follow-up: Changed 4 years ago by kzar

  • Cc trev sebastian added; kzar removed
  • Description modified (diff)
  • Owner set to kzar
  • Priority changed from Unknown to P2
  • Ready set
  • Summary changed from ensure_dependencies.py ignores more than necessary to ensure_dependencies.py doesn't add Git ignore paths relative to the project root

comment:7 Changed 4 years ago by kzar

  • Description modified (diff)

OK thanks sergz, I see what you mean now.

comment:8 in reply to: ↑ 6 ; follow-up: Changed 4 years ago by sergz

Replying to kzar:

ensure_dependencies.py doesn't add Git ignore paths relative to the project root

Could you please also ensure/confirm that it properly works with Mercurial?

comment:9 in reply to: ↑ 8 Changed 4 years ago by kzar

  • Description modified (diff)

Replying to sergz:

Could you please also ensure/confirm that it properly works with Mercurial?

Yep, already did. (Sorry I meant to include that in the description already but I forgot!)

comment:10 Changed 4 years ago by kzar

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:11 Changed 4 years ago by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.