Skip to content

repro: .gitignore files keep growing with same entries #9505

Open
@rlleshi

Description

@rlleshi

Bug Report

Description

Whenever I run dvc repro the same entries keep being appended to the corresponding .gitignore files.

Sample content of .gitignore file:

/X.csv
/groups.csv
/y.csv
/X.csv
/groups.csv
/y.csv
/X.csv
/groups.csv
/y.csv

Reproduce

dvc repro -> same entries appended in .gitignore files.

Expected

DVC should only add a line to the .gitignore file once for each file that's being version controlled by DVC

Environment information

❯ dvc doctor
DVC version: 2.57.0 (pip)
-------------------------
Platform: Python 3.10.6 on Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Subprojects:
        dvc_data = 0.51.0
        dvc_objects = 0.22.0
        dvc_render = 0.5.2
        dvc_task = 0.2.1
        scmrepo = 1.0.3
Supports:
        azure (adlfs = 2023.4.0, knack = 0.10.1, azure-identity = 1.13.0),
        http (aiohttp = 3.8.4, aiohttp-retry = 2.8.3),
        https (aiohttp = 3.8.4, aiohttp-retry = 2.8.3)
Config:
        Global: /home/user/.config/dvc
        System: /etc/xdg/dvc
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/sdb
Caches: local
Remotes: azure
Workspace directory: ext4 on /dev/sdb
Repo: dvc, git
Repo.site_cache_dir: /var/tmp/dvc/repo/32582e8b1552224ea25e5d697a41250a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDid we break something?gitRelated to git and git backendsupstreamIssues which need to be resolved in an upstream dependency

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions