#27588: Avoid affixing colon to generated migration name
-------------------------------------+-------------------------------------
               Reporter:  Charlie    |          Owner:  nobody
  DeTar                              |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Core       |        Version:  1.10
  (Management commands)              |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 This ticket concerns a minor annoyance. When generating migrations using
 `./manage.py makemigrations --empty`, it is necessary to edit generated
 file to create the migration, so users must pay attention to the filename
 generated by the management command. `makemigrations` reports the filename
 like this:

 {{{
 Migrations for 'app':
   app/migrations/0056_auto_20161210_1755.py:
 }}}

 In most X11 terminals, double-clicking on the filename will select the
 text between spaces and copy it into the mouse paste buffer.  However,
 since there's a colon affixed to the end of the generated filename, it
 gets selected as well, meaning that it's necessary for users to either
 edit the pasted contents prior to use, or carefully select all of the
 characters except the colon.

 May I suggest simply adding a space between the filename and the colon, so
 that double-clicking the name won't select the colon.  Or alternatively,
 eliminating the colon.  Allowing the filename to stand free will prevent
 the affixed colon from getting in the way.

 A one-character patch to add a space:
 {{{
 --- makemigrations-orig.py      2016-12-10 10:56:18.224099088 -0700
 +++ makemigrations.py   2016-12-10 10:50:45.518233440 -0700
 @@ -210,7 +210,7 @@
                      migration_string = os.path.relpath(writer.path)
                      if migration_string.startswith('..'):
                          migration_string = writer.path
 -                    self.stdout.write("  %s:\n" %
 (self.style.MIGRATE_LABEL(migration_string),))
 +                    self.stdout.write("  %s :\n" %
 (self.style.MIGRATE_LABEL(migration_string),))
                      for operation in migration.operations:
                          self.stdout.write("    - %s\n" %
 operation.describe())
                  if not self.dry_run:
 }}}

 This would eliminate an annoyance for X11 mouse users, and have no
 negative impact on users of other  systems.  Since it's possible that
 someone's parsing the output of `makemigrations` and expecting affixed
 colons, it could be considered a breaking change.

--
Ticket URL: <https://code.djangoproject.com/ticket/27588>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.a54c200330583cf26eb1f0461f524ddc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to