Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-23441

Use --intent-to-add when adding auto-generated files to git

    XMLWordPrintable

Details

    • c0c5773345480df8cec8d6959f89ae255eeb7d8a (qt-creator/qt-creator/4.13)

    Description

      Scenario:

      Use the wizard for creating a new C++ class with the option "Add to version control: Git". Then do some extra modifications to the files after that, like adding a GPL header to each file, and actually implementing the class. Finally, the new files are ready to be committed.

      Current behaviour:

      Running "git diff" shows the differences between the auto-generated content of the new files and the content of the files after the user is done modifying them. Running "git status" shows two different sets of changes to the files (both staged changes and not yet staged changes).

      Expected behaviour:

      Running "git diff" shows the entire contents of the file as if it was newly added. Running "git status" shows only one set of differences for the files.

      Suggested change:

      The "new file" wizard should use the option --intent-to-add when adding newly generated files to git. This tells git that the files are supposed to be added, but it does not actually add the content of the files to the index.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              orgads Orgad Shaneh
              hyperquantum Kevin André
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes