`bzr commit -m foo` should not suggest me invalid `--file foo` when foo is directory

Bug #570251 reported by Alexander Belchenko
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

Steps to reproduce:

bzr init
bzr mkdir foo
bzr ci -m foo

And I've got this spam message:

C:\Temp\1>bzr ci -m "foo"
bzr: warning: The commit message is a file name: "foo".
(use --file "foo" to take commit message from that file)
Committing to: C:/Temp/1/
added foo
Committed revision 1.

"foo" is directory there. Dear bzr, don't be so fool and don't lie me about `--file foo`. It's simply not true.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 570251] [NEW] `bzr commit -m foo` should not bother me with invalid assumption that foo is file while it's the directory

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/26/2010 11:46 AM, Alexander Belchenko wrote:
> And I've got this spam message:
>
> C:\Temp\1>bzr ci -m "foo"
> bzr: warning: The commit message is a file name: "foo".
> (use --file "foo" to take commit message from that file)

This message exists because users would do "commit -m foo" when they
meant to specify foo as a file to commit.

See: https://bugs.edge.launchpad.net/bzr/+bug/73073

> "foo" is directory there. Dear bzr, don't be so fool and don't lie me
> about `--file foo`. It's simply not true.

It's true that in this case foo cannot be used for a commit message.
It's somewhat hazier to claim that "foo" is not a file. One of the Unix
mantras is "everything is a file", and this includes directories,
symlinks, etc.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvWKi0ACgkQ0F+nu1YWqI0JtQCfUJwA0nWYTX6SY/Zs0rUCpvyP
MdgAnimhMqNfLmQ3uADbV8QNabw6oQlb
=LVF8
-----END PGP SIGNATURE-----

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 570251] [NEW] `bzr commit -m foo` should not bother me with invalid assumption that foo is file while it's the directory

Alexander, do you want this message removed altogether, or just for it
to be more precise that foo is not a regular file?

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 570251] [NEW] `bzr commit -m foo` should not bother me with invalid assumption that foo is file while it's the directory

Aaron Bentley пишет:
 > On 04/26/2010 11:46 AM, Alexander Belchenko wrote:
 >> And I've got this spam message:
 >>
 >> C:\Temp\1>bzr ci -m "foo"
 >> bzr: warning: The commit message is a file name: "foo".
 >> (use --file "foo" to take commit message from that file)
 >
 > This message exists because users would do "commit -m foo" when they
 > meant to specify foo as a file to commit.
 >
 > See: https://bugs.edge.launchpad.net/bzr/+bug/73073

I have no objections on this. But suggesting using directory as source of commit message seems silly
for me. Bazaar supposed to be smart tool and do what user means, right?

 >> "foo" is directory there. Dear bzr, don't be so fool and don't lie me
 >> about `--file foo`. It's simply not true.
 >
 > It's true that in this case foo cannot be used for a commit message.
 > It's somewhat hazier to claim that "foo" is not a file. One of the Unix
 > mantras is "everything is a file", and this includes directories,
 > symlinks, etc.

So that means that I can read commit message from directory?
OK, let's try this:

C:\Temp\7>bzr ci --file foo
Committing to: C:/Temp/7/
added foo
aborting commit write group: IOError(13, 'Permission denied')
bzr: ERROR: [Errno 13] Permission denied: 'foo'

Huh?

There is a lot of newbie users, and suggesting of using --file foo on directory creates new path for
confusion. The price to fix this UI issue is very low in my understanding, but it reduce one more
situation when people said "bzr sucks".

And I don't care about symlinks, because I don't have them on Windows XP.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: `bzr commit -m foo` should not bother me with invalid assumption that foo is file while it's the directory

Martin, I'm only care about case when foo is directory. I don't see the reasons to show such warning in the case of directory. Do you see it?

tags: added: ui
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 570251] Re: `bzr commit -m foo` should not bother me with invalid assumption that foo is file while it's the directory

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Martin, I'm only care about case when foo is directory. I don't see the
> reasons to show such warning in the case of directory. Do you see it?
>
> ** Tags added: ui
>

The specific point is that someone may type:

  bzr commit -m foo

when they meant to type

  bzr commit -m "message" foo

And forgot to type the message. So I think it is entirely appropriate to
warn for directories as well as files.

Now for the use case of typing:

 bzr commit -m foo

when you meant

 bzr commit -F foo

that is different, but still valid. But yes, it doesn't make sense to
suggest to people that they could supply -F for a directory.

So updating the check to see whether 'foo' is a file or a dir, and only
if it is a file add "you can pass -F foo if you want to use it as a
commit message" is reasonable.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvXB7YACgkQJdeBCYSNAANingCeJpmmQ9UUKUc597MA5K+lJ7os
6OwAn30Pwny6io87bI1d6N8HAeAqSUQn
=kFiX
-----END PGP SIGNATURE-----

Revision history for this message
Alexander Belchenko (bialix) wrote :

John A Meinel пишет:
> The specific point is that someone may type:
>
> bzr commit -m foo
>
> when they meant to type
>
> bzr commit -m "message" foo
>
> And forgot to type the message. So I think it is entirely appropriate to
> warn for directories as well as files.

OK, I understand this use case.

> Now for the use case of typing:
>
> bzr commit -m foo
>
> when you meant
>
> bzr commit -F foo
>
> that is different, but still valid. But yes, it doesn't make sense to
> suggest to people that they could supply -F for a directory.
>
> So updating the check to see whether 'foo' is a file or a dir, and only
> if it is a file add "you can pass -F foo if you want to use it as a
> commit message" is reasonable.

Yes, don't suggest to user invalid hint of `--file foo`.

summary: - `bzr commit -m foo` should not bother me with invalid assumption that
- foo is file while it's the directory
+ `bzr commit -m foo` should not suggest me invalid `--file foo` when foo
+ is directory
Changed in bzr:
status: New → Confirmed
importance: Undecided → Low
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.